News for hackers. Stuff that matters.
Re:Defensive CSS by eurasiantiger on Wednesday July 06, 2022 @04:30PM (#32006413)
That’s not what the site is about at all.

It’s ”defensive” in the same sense as ”defensive programming”: handling possible future / edge cases gracefully.

Re:Defensive CSS by distantsounds on Wednesday July 06, 2022 @05:18PM (#32006946)
the fact you can set a CSS version in your code, and have it not act as it did when that version was originally standardized, is exactly what being "defensive" is about. the code you wrote years ago doesn't work anymore because the browsers have decided to do things differently now.

and yet I can run applications from 30 years ago and it will still function as it once did. no hacks or code changes required.

you shouldn't have to "future proof" source code against an outside entity just coming in and breaking it all. especially when it's supposed to be an open standard.

Re:Defensive CSS by rimliu on Thursday July 07, 2022 @03:29AM (#32010918)
Windows is full of hacks to allow that "I can run applications from 30 years ago" to happen.
Re:Defensive CSS by squidbeak on Wednesday July 06, 2022 @08:11PM (#32008496)
I'm curious which css code from years ago won't work any more. Care to elaborate?
Re:Defensive CSS by noisymemories on Thursday July 07, 2022 @05:54AM (#32011882)
Not OP, but flexbox went very famously trough a few breaking changes throughout its early history: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexibl...

There were also some more subtle behavior changes a few years ago in the way webkit handled unprefixed flex-direction centering properties (align-items, justify-content) together with min-width/min-height attributes, switching from behaving closer to IE11 in this regard to basically emulating Blink. AFAIK neither behavior was really against-spec.

And if you really want to go all-in with some really deep philosophical questions, I can suggest you the following: Is it possible to center text in a select box? https://stackoverflow.com/questions/10813528/is-it-possible-...