The list reminds me of when people refactor code and then just rename things. Ok, foo should've been called bar, but is that really a design mistake? The biggest design mistake for me is that it contains the letter C - it never should've been cascading. There's probably a need to resolve conflicting rules but it never should've been THE feature around which the language is designed. The precedence algorithm, the spec…
This is interesting because my first reaction was to recoil in horror at the idea of CSS without the cascade, but my second reaction was to realie you're actually describing approximately how Tailwind works eg small classes that you can use to apply an aspect of styling to a specific element, and use to build up to a design. Utility classes would be the obvious choice if you couldn't rely on the cascade any more. Tai…
Mistakes in the Design of CSS (2013)
111–120 of 147 posts
Re: Mistakes in the Design of CSS (2013)
#112Make flexbox the default layout for everything, and add a flex-snap feature that will snap to the nearest multiple of some given size. I'm not sure we actually would still need grids. I also wonder if you couldn't have a more transparent and parameterizable auto width algorithm based on a lowest cost solver. So you could say "If this element wraps, it's cost 50", meaning you want all the boxes to stay on as few lines…
Would that impact performance negatively?
Re: Mistakes in the Design of CSS (2013)
#113Make flexbox the default layout for everything, and add a flex-snap feature that will snap to the nearest multiple of some given size. I'm not sure we actually would still need grids. I also wonder if you couldn't have a more transparent and parameterizable auto width algorithm based on a lowest cost solver. So you could say "If this element wraps, it's cost 50", meaning you want all the boxes to stay on as few lines…
How would your flex box solution handle a simple two column layout where the first column is a variable size? There isn’t a fixed multiple to “snap” to.
Re: Mistakes in the Design of CSS (2013)
#114> background-position and border-spacing (all 2-axis properties) should take vertical first, to match with the 4-direction properties like margin. I hate that margin / padding short-hands, especially with 2 values, expect vertical first. In my head it's always (x,y) and (width,height) – always horizontal then vertical, I feel like it works like this everywhere else? Now my issue is that I've committed to memory that…
North East South West (never eat sour worms) not East South West North
Re: Mistakes in the Design of CSS (2013)
#115Backwards compatibility may be a fundamental design philosophy of the web, but wouldn't it still be possible to support a different document format with a new programming model that gives us a clean break from the past? It's a naive question, I realize, but it's tantalizing to imagine what we could have if we went that route. Then again, the cynic in me thinks we'd just endlessly fight over the design decisions anywa…
Google would like to have Dart replace JavaScript too.
Re: Mistakes in the Design of CSS (2013)
#116The biggest fuckup of CSS, to this day, is lack of vertical centering of content.
Re: Mistakes in the Design of CSS (2013)
#117Earlier quoted context omitted.
> Note that the Tailwind team strongly anti-recommends @apply and regrets ever putting it in there Please link to something that supports this claim, because it's not the first time I've seen it made on HN, but only found it on HN
It's accurate. Here you go: https://twitter.com/adamwathan/status/1559250403547652097?la... https://twitter.com/adamwathan/status/1226511611592085504?la... https://twitter.com/adamwathan/status/1296770370209566720?la...
I'm sure new users of the system will find that. Great job everyone.
FFS
Re: Mistakes in the Design of CSS (2013)
#118Earlier quoted context omitted.
Well the `!important` is a good example if general misunderstanding of the core basics of the CSS: the cascade. People usually think it means something like "override everything what was declared up until now in a way I don't need to check the selector specificity" , while in reality it means *"teleport this certain declaration to the higher mirror cascade origin realm"*, what is way cooler yet mostly unknown concept…
Whoa, that's weird. So once there is `!important`, the order of precedence flips? I'm sure there was a good reason for that...
But then if the user is tweaking a specific site, the user should be able to override anything with ! important if they really mean it.
Re: Mistakes in the Design of CSS (2013)
#119I thought "!important" was always about appealing to the emotions of overwhelmed and confused CSS authors as it seems to make the computer "listen to you" when it doesn't seem to be. I remember this notorious book https://www.amazon.com/Creating-Killer-Sites-David-Siegel/dp... about techniques used to get pixel perfect results with HTML back in the 1990s. The author of that book was quite impressed with CSS as it rea…
Kind of hard to see Bootstrap and Tailwind so casually lumped together with regard to how they break semantics, as they are at least an order of magnitude apart in that. Bootstrap will throw in a p-0, but Tailwind is designed to essentially make everything a p-0. And that's an important distinction, as I think the current challenge with CSS for designers (and everyone) is that it now sits between design and developme…
This articulates a problem I’ve had with Tailwind for a while, and not quite been able to put words to.
Re: Mistakes in the Design of CSS (2013)
#120> The top and bottom margins of a single box should never have been allowed to collapse together automatically as this is the root of all margin-collapsing evil. Disagree. All margins, including horizontal, should collapse. Typically you want 20px between buttons, not 20 + 20.