CSS can be really challenging — but it's hard for me to nail down what exactly makes it so. Would love to spark a conversation!
For further actions, you may consider blocking this person and/or reporting abuse
CSS can be really challenging — but it's hard for me to nail down what exactly makes it so. Would love to spark a conversation!
For further actions, you may consider blocking this person and/or reporting abuse
Latest comments (41)
In my opinion CSS was much harder back in the day when everybody was forced to use floats and clearfix to put together a design. Or even worse in the dark days of web development when everybody used tables.
Now with flexbox and css grid its much easier.
My experience with
bootstrapand design systems were a super overblown CSS ruleset, over a Mb bundled for every team's frontend part. So people crossing parts in the application meant to download those CSS bundles.Of course, if people would have better knowledge over CSS and CSS tooling they could have just broken it up to have a separate CSS for just the design system, and one for their own app.
Then you have another problem of however modular and smart is your system, UX and UI design will figure out something unique: you should make exceptions for the customers. So in the end you will have a big, bloated design system for every use case, yet you are regularly writing exceptions, overrides and custom elements for actual use cases.
On the other side, a design system and existing elements are extremely productive. But it requires some really great CSS developers to find the right balance.
There is also a problem of
CSSbeing alowlything that people just don't learn properly. And then they start to force the same methodologies that only work in the language they have learned them (e.g. a Java class oriented system in Java, a functional approach in JS). ButCSSis designed totally differently, you can't "reuse" the same tricks from other languages.every-layout.dev/rudiments/global-...
Mybe it´s worth looking back to the roots of CSS.
HTML and CSS have been invented in a time, where networks had a very limited capacity and people used acoustic modems on a telephone line to access the internet. HTML some features to make documents more readable (like headlines and bold face) with a minimal overhead, but you could not even use color (because people at CERN had only monochrome displays).
To make document more readable, CSS was the perfect solution. Instead of adding format information to every part of the document, CSS simply changes how the machine works: You only define once to make all headlines red, not for every headline you use.
This was really efficient so save bandwidth, but gave you some headache if you need special formatting for a single item. That is where the trouble starts: You need to define some qualifiers like id´s in HTML and use them in CSS (or - if you like - define some classES in CSS and use it in HTML). That gives you a serious amount of overhead, if you want to apply CSS to a single element and makes things hard to maintain. You can use inline styles instead, but that makes it even harder to maintain. And - may have some serious unwanted side effects too.
CSS has some serious design flaws. Most of all:
There have been several attempts to solve this, but most of them seem to solve one problem but give you two new headaches.
The only thing you can say about CSS is: It is like it is. I´m pretty sure that - if somebody had to invent a new internet from scratch on a current hardware - things would look very different from what we see today.
With the
bootstrapdirection I cringe every time I see people useflexasclass-es. Basically you have to know and writeflexto be able to use theflexutility classes. Then why not writeflexin a stylesheet in the first place?I don't think is hard, I just think people, web developers mainly, need to spend more time having a good foundation on it in order to propagate into more difficult topics. IMO, css should almost be treated as its own programming language.
I'm quite new into web-development, and when I started applying css on my own i found what makes it hard in the beginning is that there are tons of properties to apply for styling, it can feel overwhelming. But as you work on more projects, there are certain properties that you will end up using almost always, like display: flex, justify-content, font-size etc. And as you use them more often you will understand how they behave, and also relate to one another.
I would also say, that what can make css hard to apply, is the structure of the html file. If the html is not structured properly, one might spend more time getting the correct layout done compared to if the html file was structured differently.
Because CSS hates you. It hates all of us.
Because you actually have to learn how it works. Not just which properties to use but also CSS-specificity and everything around html as a whole.
People don't want to learn and and expects frameworks to do everything for them.
It's a cumulative thing since many years ago that never purges itself, thus making its solutions very inconsistent over time.
In my opinion:
Here's my tips for working with CSS:
contact-form-send-buttonclass. Have abutton--submitclass instead.js-eg :js-close-btn.