Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 24, 2021 06:34 am GMT

In defense of CSS

I am here to take a stand and defend CSS, my most favorite programming language. I don't care if it is a proper programming language or not, and I don't think the authors cared, too. However, I do care about its beauty, power, simplicity, and complexity.

Side note: I askeda question about respecting CSS on Dev.toearlier this year. Unfortunately, the discussion escalated and went in the entirely wrong direction.

If you started to learn CSS in the last couple of years, consider yourself lucky. I have been kind of lucky, too, and I have avoidedtable layouts, but I had to deal withfloat layout. Today, CSS is much nicer and friendlier, and you don't need to use too many "hacks." No matter what, I always loved it.

The thing with CSS is that you need it, whether you love it or not. Cascade, stacking context, box models, these could be tough and abstract, but you need these to be your friends, not enemies. It is easy to jump straight to frameworks. Bootstrap, Tailwind, Bulma, whatever, these are great, but it comes down to mastering the basics. I have been the loudest spokesman of Bootstrap for years, but I had to master the CSS basics anyway. Although I rarely use frameworks these days, I am still curious, exploring new and shiny players here and then. There is nothing wrong with broadening your horizons, as long as you know the basics.

CSS is moving fast. New features emerge every year, making our lives both harder and easier. Sometimes a new feature adds more complexity. TakeCascade Layers, for example. It will be hard to master the concept of controlling the cascade. But, sometimes, a new feature provides a more straightforward solution. Take theaspect-ratioproperty (which is finallysupported by all major browsers, btw). It feels so good not to use the padding hack anymore. Whether a feature is complex or not, the important thing is that CSS is moving in the right direction.

Just like you need CSS for web-based projects, you need JavaScript as well. I am not a JavaScript developer, but I use JavaScript daily. I know enough to get by and to avoid mistakes. Whenes6was introduced, I was afraid of it. I did not even master thees5, and the new JavaScript version was out. I tried to ignore it, but I could not do it forever. So I had to learn it and understand how and when to use new features. Eventually, it made my life easier, but the learning path was not straightforward.

What I did not do wascomplainall over the Internet about it. Instead, I got my hands dirty and wrote a tone of code until it made sense to me. I did not expect to do it without spilling blood, sweat, and tears. It doesn't work that way.

Before you decide to write something terrible about CSS, try to understand what is going on first. Mastering CSS is all about understanding the context and concept and everything in between. It is not CSS' fault that you don't know how to use it.

It is not CSS' fault that you don't know how to use it.

If you don't write CSS often, you shouldn't be bothered. JavaScript superheroDan Abramov admits he doesn't know CSS(if you have 5 minutes, you couldwatch Dan trying to center a div). So please don't rant about CSS if you're not using it regularly. Everything is hard when you don't use it. However, if you use CSS daily, you better start learning CSS and get better at it.


Original Link: https://dev.to/starbist/in-defense-of-css-2og8

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To