9

Have you ever wondered why !important is even working? Imagine this:

element {
color: #FF0000 !important;
}

It literally means the red color is NOT IMPORTANT. And this overwrites previous CSS rules such as in this example, previous element.color. Like seriously, where is the logic here? :D

Comments
  • 0
    Man. I hate CSS. :P
  • 0
    Some things you just gotta accept :D
  • 0
    @Greggergalactic Because it's super super important!
  • 1
    CSS is not a programming language and therefore the ! should not take on the meaning it has in programming and in normal language it means yelling which kind of means important in real life so...

    I'll show myself out...
  • 1
    @Greggergalactic you said it yourself - in development. CSS is not a devs job, it's a designers job who doesn't have to know a thing about programming, not even JS.
  • 1
    @Greggergalactic because companies don't want to pay separate designers and then you get apps looking like they were designed by a blind platypus. But normally, the designer should design and do the HTML and CSS, but not the JS and the dev should do the JS and backend.
  • 1
    @Greggergalactic yeah, but creation of the important CSS keyword predates that bullshit or even if it doesn't, it was meant for designers so that's why it's like that. You can't foresee who is going to end up using your product, in this case CSS, so you can't cater to the people who end up using it
  • 1
    @Greggergalactic yeah, I added the "show myself out" part in the hopes of conveying sort of a sarcastic tone... Guess it didn't work :)
  • 0
    nice reading, guys 😃
  • 0
    @Greggergalactic that img is EXACTLY what I was thinking XD
Add Comment