Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wasn't there, but putting myself in the headspace of someone who was and may have had to comply with that law: There are things outside of the individual control of the designer that can override everything except !important. The most obvious example is non-!important rules in user stylesheets.

Today it's obvious that overriding a font-size with a user stylesheet is a bit of an extraordinary measure. You're unlikely to have any legal issues based on somebody shrinking your text using one. This may not have been obvious in the meetings in which CSS was being designed: it's plausible that I might think user stylesheets would be all over the place and have unpredictable effects, including shrinking disclaimers or whatever. On the other hand, putting !important in a user stylesheet could've seemed like an extraordinary measure even then.

But again, I wasn't there. I'm just making semi-educated guesses.



Still, it doesn’t make sense why US law makes it necessary to have this feature, but any other business or design requirement wouldn’t make this feature necessary. Surely if the CEO or designer says “this text must be 24px” that’s not any different from the implementer’s perspective as a law which says the same thing. This whole thing doesn’t really add up.


It's different from the implementer's perspective because the implementer can go back to the CEO (maybe indirectly) saying "I can make that work 80% of the time, but it just can't be done for the 20% of users who have expressed a preference to the contrary". In your example the CEO gets the option to say "OK, make it work most of the time". In a compliance situation, the CEO is legally obligated to can the whole project, find someone willing to put the text in a JPEG with the attendant accessibility issues, or some other draconian maneuver.


If you send me a government mandated form, and I scrible on it, you aren't liable for anything. The only potential concern is if the content is deployed through a framework like Wordpress that might add CSS.


> This whole thing doesn’t really add up.

If the originally purported intent had carried through to the specifications, it adds up in a sense. If !important overrides indicated an explicitly set formatting/sizing for compliance/legal reasons, implementers touching it without any historical context would know at a glance what it signified and that it shouldn't be touched lightly without explicit approval. And when the implementer updates the stylesheets to use 24px text on a page based on direction from the CEO/designer and the element with an !important override stays at 26px, the implementer can point to the !important override as the cause and confirm if the person requesting the change has confirmed legal/compliance approval to change that one as well. Even if the parties involved in the change (the designer, CEO, or implementer) aren't familiar with the compliance reason for the override's origins, the fact that it's there is a known flag that changes can lead to potential violations and costs/fines and need to be properly vetted for approval.

It would also make it easier to go in and update the stylesheets to comply with changes in compliance/legal requirements, as you can easily search through the styles for !important flags and find all the spots that need reviewed for potential change needs.

That said, its use in practice is completely different than this purported rationale for the flag's existence, and !important is sprinkled so cavalierly in existing codebases to crudely but effectively get a desired effect that the above situation is impossible at this point and the original rationale is moot.


> You're unlikely to have any legal issues based on somebody shrinking your text using one. This may not have been obvious in the meetings in which CSS was being designed: it's plausible that I might think user stylesheets would be all over the place and have unpredictable effects.

Someone predicting "stylesheets all over the place" would have been exactly right, though - practically every single news page on the Internet has questionably-sourced ads, Facebook like buttons, Twitter embeds, and chat/discussion/engagement widgets, all of which have custom stylesheets. The only saving graces come from frequent use of iframes for isolated embeds (which will become less common now with cookie restrictions!), stylesheets well-engineered by well-funded corporations to have every rule prefixed by a custom and dedicated class name for compatibility, and preprocessors and CSS-in-JS that would make that latter approach viable.

Now imagine a world where you're a site operator, !important doesn't exist, and you cannot trust that a site component provider will not install a global CSS rule that will break your legal or branding requirements, with no real way for you to work around it if they do, without unmaintainable specificity boosters for your own components. You simply won't use that site component provider unless it's well-vetted. Which means that there's significantly less innovation on the Internet, because "nobody ever got fired for embedding IBM CSS" becomes an actual thing to think about. !important becomes the escape hatch that the web needs.


>The most obvious example is non-!important rules in user stylesheets.

You are fundamentally unable to force the user to render the text you send them in a particular font size, !important or not. What if they use a text browser and small font size in the terminal?

The legal requirement explanation makes 0 sense.


There is no law for the designer of CSS system. Only the developers who build UI have any liability to comply with the law. As long as CSS allowed them to render the required font-sizes there was no reason for them build breaks to the cascading to "comply with law", perhaps it makes it easier for developers with this feature to comply to the law, but there was no requirement to make it easy .




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: