15kb of CSS is all you’ll ever need ⚡️
Philip Ardeljan
27128

While I agree you can get a small CSS file that doesn’t need to grow this way… you now have a new WORSE problem. You’ve got class-itus!

Now your DOM will be littered with crap like:

<div class=”b1 tc p3 m4 c6 bgc3">…</div> on all your elements which becomes an unreadable nightmare and you need to style everything to get what you want.

I’m always amazed at how many people miss out on the concept that CSS was built on, the “C”, the Cascade! This is the power of CSS and you’re missing out.

Likewise outside of the cascade, you’re going to have certain elements that you will always want to render the same. Every text input box will have the same padding, the same border, the same colors, the same effects for the hover, focus, active, readonly and disabled states… define this once in your CSS and you’re done! (of course you can still use CSS to adjust the width of your input to suit, and provide a contextual hint as to what the content should be)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.