Live data from Hacker News

Incomplete list of mistakes in the design of CSS

wiki.csswg.org

61–70 of 132 posts

Re: Incomplete list of mistakes in the design of CSS

#61
post #47

I will never understand the bizarre scene of the web's smug collective declaration that tables were dead and not to be used juxtaposed against the years it took to regain the ability to reliably center things. Assuming one agrees that we even did regain it. Related: I also love when I can't paste tabular data into Excel/etc. anymore For the record, I don't hate the idea of stylesheets, but...sheesh

I try to politely debate the proponents with each hype cycle giving them the benefit of the doubt. They lost the "lets get rid of tables" debate quite miserably. I would quickly slap something together in jsfiddle, they would try recreate it. Adding some col- and/or rowspan programmatically for cells with the same value. Give an rgba color to rows and nth cells (columns). Resizing columns by size of cell content. It…

>Give an rgba color to rows and nth cells (columns).

that sounds like a use for tables, so I find it difficult to imagine a non-table layout that would want this.

>Resizing columns by size of cell content.

I can sort of see this as a requirement for non-table layouts that would not work well, however my experience from table time was that was one of the biggest irritants at least for me, that columns would haphazardly resize based on what was in them, and sometimes you wanted them to and sometimes not. As a general rule I found it better design wise to truncate text rather than have things expanding and contracting in response to what copy editors were doing.

>framesets are here to stay now

woo yeah, I see them a lot in the wild. I mean really the only time I really see frames used anymore are iframes and generally in eCommerce and similar security requiring solutions where the frame can be partially controlled by the storefront, but is more fully controlled by the payment provider. I just find the statement "framesets are here to stay now" really weird and triumphal for something that is so rarely used?

>I still have one of the funnier "how to make this without tables?" challenges.

I followed the link, I would think it is better suited to a "why would you make this" challenge. I'm not sure

1. it shouldn't be a table. seems like maybe it should be

2. why the freaky animation. or for that matter why the animation nearly crashed my browser.

I'm definitely sure lots of designs could not be adequately achieved without tables and framesets, but my experience seems to have run contrary to yours because for me CSS was a godsend in fixing the things I found irritating about those two technologies, this does not mean that I never encountered situations where I thought this would be easier with tables, but as soon as I tried putting tables back in I found all those irritants came back in.

From my experience tables and framesets were best suited to layouts that are rarely ever wanted, and when used to implement slightly different layouts had too many problems and irritants to be useful.

Your mileage has obviously differed, but I'm not sure that "here is a particular problem that people seldom wish to solve and which I have constructed, that plays to the strengths of my favored technology while avoiding its pitfalls" is as impressive an argument as you seem to think it is.

Re: Incomplete list of mistakes in the design of CSS

#62
post #56
post #49

I don't understand the point about comments. Why shouldn't they be allowed? What object model? >Comments shouldn't have been allowed basically everywhere in CSS (compare to HTML, which basically only allows them where content goes), because it makes them basically unrepresentable in the object model, which in turn makes building editing directly on top of the object model impossible

The CSS Object Model. HTML comments are basically just a HTML tag that isn't rendered. Tools that 'compile' the HTML code into a document tree, including browsers, preserve comments as nodes without any extra effort. CSS comments can go anywhere: /*wow*/ .selector /*x*/ {animation /*z*/: 2s /*z*/ linear /*z*/ bounce;} Tools that transform/parse CSS can either: 1. Strip comments before parsing, meaning anything based…

But if it's valid CSS it has to be representable in AST/object model? It's a comment, it can't have any child nodes, it doesn't depend on anything - pretty trivial. And if it's in the tree you can transform it with proper tools. If you are transforming CSS you have to write a proper parser and not just a bunch of regexes

EDIT: also why is it useful to have comments in the object model in the first place? To access them from js?

Re: Incomplete list of mistakes in the design of CSS

#63
post #60

Earlier quoted context omitted.

sidenote: as a teen, i would regularly layout posters and presentations in excel.. the page preview dashed-border and the grid stability was such a relief compared to word

On commodore 64 the screen is just a fixed size grid of characters. No one ever had issues making an ui. We pretend but flexible viewport size is not actually possible. If you are making a painting for example the size of the canvas greatly influences what can and can be done. I made a stunning landscape photo one time that looked great only when displayed at roughly the size of a hand. If made larger undesirable det…

> We pretend but flexible viewport size is not actually possible.

Not beyond a point, but it's still very useful to be flexible up to that. For example, I'm very grateful that a web page will reflow text rather than print everything on one line and force horizontal scrolling.

Re: Incomplete list of mistakes in the design of CSS

#64
The greatest mistake IMO is the way float state leaks out of blocks, as this is both extremely unintuitive and undesirable for performance reasons.[1] Floats should've been restricted to inline formatting contexts, with all in-flow blocks behaving as if they had `clear: both' set.

I also don't understand why they never specced the (much simpler) `text-align: -moz-left/-moz-right/-moz-center' which already had precedent in HTML with `'. It's the saddest part of the "center a div" saga, all the W3C had to do to fix it is to assign a standard keyword to a feature that everybody already implemented, but to this day it still hasn't happened.[2]

[1]: https://pcwalton.github.io/_posts/2014-02-25-revamped-parall...

[2]: After many long decades, they did finally specify block-level `justify-items'. Two problems: a) it's backwards-incompatible with text-align, b) it still doesn't work in Gecko.

Re: Incomplete list of mistakes in the design of CSS

#65

Earlier quoted context omitted.

No, dealing with tables was like trying to build a house out of tempered glass. With css grid, I can tell each element which area or column+row to occupy. If I add or remove a random element, the rest of the elements stay in the correct place. But do that with a table and you end up trying to glue your house back together shard by shard whilst trying not to cut yourself or breaking things more.

> If I add or remove a random element, the rest of the elements stay in the correct place. This complaint highlights how absurdly not fit-for-purpose html+css actually is. Okay, you may want to do "responsive" design, but you have the semantic layout fixed, therefore you try and contort a styling engine into pretending to be a layout engine when in reality it is three stylesheets in a trenchoat.

>This complaint highlights how absurdly not fit-for-purpose html+css actually is. Okay, you may want to do "responsive" design, but you have the semantic layout fixed,

this not fit for purpose may in fact be historically superseded usages that still are baked in to some usages affected by the relatively rapid change of the various platforms that must interact and use the respective technologies, the specification version of "technical debt"

that is to say some subsets of the numerous technologies can be used to construct something fit for the purpose that you are describing, but as a general rule anything constructed in a solution will probably be using other subsets not fit for that particular purpose, but maybe fit for some other purpose.

Re: Incomplete list of mistakes in the design of CSS

#66
post #4

I'd like to propose for the list: Default heading styles should not have equal top and bottom margin. Headings should be closer to the content they label than to the content they are setting their content apart from. h1, h2, h3 should not have different styles. it's an anti-pattern that leads to broken accessibility

moreover h* is just broken whenever dealing with more dynamic content — it simply can’t reasonably be made to work according to accessibility recommendations — and the accessibility guidelines around never skipping a level themselves are ridiculous given the practical reality that dynamic content exists and we have only h1, h2, etc. to work with — the readers and specs are what need to adapt here, not the entire inte…

The problem with trying determine heading depth automatically is the depth is not something that can be deduced just by the structure. If headings are siblings, for example, the may be on the same level semantically or not.

One way I've dealt with this in react is combine a Heading component with ContentGroup component. Each content group needs exactly one heading, and heading can't exist without it. Content group can contain other content groups. The tag for heading can then be determined by how many content groups are in the tree above it.

This works pretty well ime, but it can be hard to get devs to use (or think about accessibility at all).

Re: Incomplete list of mistakes in the design of CSS

#68
How could CSS (or any language) have been designed so that these mistakes could have easily been corrected today in any case?

If the mentioned mistakes or similar language design mistakes were made. Because mistakes will always be made.

(Unison lang comes to mind but it’s refactor failsafe seems narrow. How about: Antifragile language design? Self-correcting language?)

Post reply on HN