If you can, then imagine a world where there is no styling in websites. It's close to impossible, right?
Being in the frontend industry for quite some time, it's very hard to not use CSS in a project. I mean, one of the foundations of a website you create is CSS! Having no CSS is like living a faded life. No excitement, no moods, no emotions, just a straight-up structure with some content in it.
This is completely a different article of what I usually write on a weekly basis. I stumbled upon this topic a week ago when I was browsing some resources for my upcoming newsletter. Due to some reason a link opened after quite a long time.
Turns out, the server was really slow to respond. I thought maybe it's a browser issue, so I switched from Chrome to Firefox. The same happened. I opened dev tools to see if there are some errors which I can take a look on. There was nothing I could possibly do as some of the errors were out of my head.
Then I started experimenting (you can blame my curious mind for this). I opened up the Settings and tried to fiddle with things like:
- Turning off some extensions.
- Enabling service workers.
- Recording a performance analysis in the Network tab.
And more such things.
Out of (I don't know what) curiosity, I started searching for "Disable CSS in Firefox". Well, I think that it was because of that last point stated above. I tried to disable JS, the page reloads, and still, the website wasn't opening (please don't ask what website that was, it was a pain to remember the name as it was in a foreign language).
I got to know that you can do this in Firefox by hitting the alt key, then v -> y -> and finally n. Basically this...
This activates the "No Style" mode in Firefox so the page you're currently on has no CSS style sheet rules in it. Of course, that horrible website even now couldn't load properly. So I gave up on that and did something weird next...
Yes, I did this. I visited some of the most popular websites on Earth to just explore how they would look. Of course, I knew they would look bad, but how bad?
⚠ WARNING! DISGUSTING AND UGLY WEBSITES AHEAD. SCROLL AT YOUR OWN RISK. ALTHOUGH I KNOW 99% OF YOU'RE GONNA SCROLL SO JUST GET STARLIGHT INTO IT! 😈
Eheheh, funny but here are some of the things I got to know about it.
- The use of
font-family: sans-serifis heavy throughout the body as it's usually a text-based content website.
line-height: 1.6plays an important role to have a clear read of its content.
- They use quite a LOT of borders.
- The immediate thing you notice is the extensive use of the carousels they use to showcase some products. So here, properties like
heightplay a great role.
- For the categories section, they're using the grid display.
- Apart from good use of SVGs, the
background-imageproperty makes the difference here.
- The form uses some pseudo-classes,
- Centre-aligned text is important!
- In the navigation, there is a good use of
- Surprisingly, the entire IMDb logo is made up of SVG elements which obviously used
- Again, for the anchor tags, there is padding everywhere.
Can't tell much due to the integrated use of some CSS framework or library of whatever...but, yes, the buttons having an SVG do have
transform: rotate(0) properties.
Before you start thinking, "Why the hell he turned off CSS?" I want to tell you that I did this 'experiment' kind of thing to clear out two things:
First, a CSS framework or not, PLEASE DO NOT UNDERESTIMATE THE SHEER POWER OF CASCADING STYLE SHEETS! Make it a habit for using pure CSS in your learning, you have no idea how many CSS properties you are not using!
Second, well, if you take a look at some of the CSS properties discussed above, you get to know that THESE CSS PROPERTIES ARE HEAVILY USED AND MAKE SURE YOU KNOW HOW AND WHERE TO USE THEM.
I turned off CSS, you might have turned off JS way before but how about you turn off HTML now? Well, of course, if you take this seriously, then there will be nothing to critique...or to learn.
Thanks for reading, I appreciate it! Have a good day. (✿◕‿◕✿)
Why was she disappointed? 😂— Coding Interview Coach (@CoachCoding) August 5, 2020