2 ms·
I second that. Well said. Trying to get something look like you want with CSS takes too much time. If you know what you want it should be easy but it takes a lo
by galaxyLogic 5y ago
I second that. Well said. Trying to get something look like you want with CSS takes too much time. If you know what you want it should be easy but it takes a lot of trial and error. Because of that we now have Flexbox and Grid. The problem with all the new add-ons is the amount of stuff you must learn and remember about how they work and how they work together, or don't, to get the results you want.
Then to hear from someone that the problem is "You don't understand the cascade" is annoying. The question is why don't I understand the cascade? The answer is because it is complicated, and it's not only about understanding it in principle but about then understanding its effects on your (current state of) application, and how you should or could change the cascading elements and or where they are defined to make your app look like you want.
And then the answer is perhaps: "Clearly you don't understand it but it is really easy" -- implying it is difficult for you because you are dumb or lazy and not a very good developer in general. Give me a break :-)
I wonder if it would help if the !important -feature should in fact be extended so you could have !important2, !important3, etc. with increasing levels of importance. That might make things easier, in practice. Or even better make it work like "z-index" does. If z-index can take on any numeric value including negative ones, why not have the same with "importance"?
That would mean that instead of having to calculate the "specificity" in your head, correctly, to understand what is happening with your app, you could just choose the specificity you want and make it part of any rule whose impact you want to differ from the default.
"Custom Specificity for CSS"
- willseth 5y ago> The question is why don't I understand the cascade? The answer is because it is complicated ... This is exactly his point! You think it should be correct usage because "CSS is too complicated." Great, good point, most of us would agree that CSS is too complicated. But that does not make it correct usage! It only means CSS is so complicated most people don't use it correctly. A majority of people misusing something doesn't make it correct. I would have assumed with the level of pedantry that is standard on HN, more people would understand this. But I think in this case the power of fragile egos has overwhelmed pedantic instincts.