Published on February 5, 2022 •
Updated on June 13, 2024
Hey! So you came here to see another CSS framework? right? So time to worry, I am telling you how to create your CSS framework instead of using one. So let’s begin!
Glad you asked now, go to a bootstrap site and then go to a vanilla CSS site. Now you see the difference I’m talking about.
When the page with Bootstrap loads in 2s the page with vanilla CSS is loading in less than 1s ?.
Let’s get started!
So we’ll build this using pure CSS!
1. Create the page with the framework
Yes, do this first in development. And follow the other steps.
2. Inspect the styles
So this is the tricky part to do but wait! There are Firefox devtools for the rescue.
Now if you select an element and go to the computed tab there is the CSS we need! So I’ll copy the HTML first.
I’ll reduce some classes ?
And before we start with the CSS, I’ll apply some fixes.
So we will get something like this
Nice.
Now, we’ll first create the overlay. So with just basic CSS knowledge, you can do this
Now we have the items centred. Now, we need the background colour, How do we find that? easy! Select the element and go to the computed styles tab and there you will see its background-colour
Now I’ll add it.
Nice. The next thing is to style the modal, so for this to I’ll do the same stuff.
Yay! ?? but wait there’s more. So I’ll style the other stuff too.
So far we have this,
Now, I’ll create an SCSS mixin for the buttons.
And we’re done!
So you see how easy was that? You just need some patience and some effort and you can build optimized websites fast. So see you next time!