Live data from Hacker News

CSS Grid – Table layout is back. Be there and be square

developers.google.com

241–250 of 280 posts

Re: CSS Grid – Table layout is back. Be there and be square

#241
post #229

Earlier quoted context omitted.

Here's the fundamental problem with separating styling from content: styling is content. Layout matters. Layout carries semantics. Right here on HN is an example, where the comment reply chain is indicated with indentation. The meaning of a comment such as "I disagree" varies depending on what it is replying to and therefore where it is in the layout. Other examples where layout is content: Captions for photos. An on…

> Right here on HN is an example, where the comment reply chain is indicated with indentation. T-hawk Right here on HN is an example, where the comment reply chain is indicated with indentation. random28345 HTML is a tree of element nodes, the identity of the post being replied to can be determined by the position of element in the tree ---------------------- .replies { margin-left: 2em; }

Exactly what I thought. The CSS make a visual indentation, but carries no more semantic than the data structure does already.

In fact, if it did, I would consider the HTML broken.

    
    ...
    
    
    ...
    

Re: CSS Grid – Table layout is back. Be there and be square

#242
IMhumbleO the redundancy is at issue, because CSS is simply nested key pairs and so say that HTML should handle only text and tagged divisions in text with IDs and classes, and leave all the semantics up to the sheets. Folks who point out that style is semantic are correct, so it's redundant to allow all these structural tags in HTML that are intended to give semantic formatting to text, and instead CSS should be reliably the only source of semantic formatting. Therefore, only one HTML element and everything else attributes or key pairs in the sheets.

Also I find js2css works well to keep component style in place with MVC web components.

(This comment is a response to the multiple inevitable discussions on the merits of HTML/CSS and what is bad or good and how it all should be different, great stuff, thanks for it)

Re: CSS Grid – Table layout is back. Be there and be square

#244
post #216

I don't know how to say it politely but what has been achieved by using ad-hoc syntax such as this gem (and similar complex CSS syntax): display: grid; grid-template-rows: 150px [nav-start] auto 100px [nav-end]; grid-template-columns: [header-start] minmax(200px, 3fr) 9fr [header-end]; CSS fans for some reason seem to think that its somehow better to have rendering/presentational properties in an ad-hoc language. Ori…

It's very easy to declaim one or another layout system as verbose or inconsistent. Can you suggest a mainstream layout system that offers this feature in a better manner? I've used a lot of different layout frameworks over the years. Constraint systems are neat but hard to scale. All-code layout definitions are hard to read and reason about. Markup-level layout systems have their issues, but are easier for new progra…

"Can you suggest a mainstream layout system that offers this feature in a better manner"

I've done better looking/performing layouts 20 years ago with plain HTML 3.2. CSS is a mess.

Re: CSS Grid – Table layout is back. Be there and be square

#245
post #240
post #229

Earlier quoted context omitted.

Here's the fundamental problem with separating styling from content: styling is content. Layout matters. Layout carries semantics. Right here on HN is an example, where the comment reply chain is indicated with indentation. The meaning of a comment such as "I disagree" varies depending on what it is replying to and therefore where it is in the layout. Other examples where layout is content: Captions for photos. An on…

Ugh, no. Layout is one way to express those relationships, but those relationships already exist in the HTML. This is important because different layouts can express the same relationship. I can put a caption below, above, beside, or over a photo and have viewers understand what is meant but which option is appropriate can depend on a number of factors that have nothing to do with the actual content or relationship b…

Sure, it's dead simple for one particular semantic case already with its own specific definition in HTML. But you cherry-picked that from my examples. HTML doesn't express semantics for comment-replies or sports scores or so on. It has a generic notion of a hierarchical tree, to which CSS can apply layout (like indentation for HN comments), but that's not quite the same thing. Nothing in the HTML-CSS stack expresses general-purpose semantic relationships and we tend to make an inner-system-effect mess of it when we try.

Re: CSS Grid – Table layout is back. Be there and be square

#246

Earlier quoted context omitted.

IMO, HTML/CSS have always been missing a middle layer. It really should be: - HTML for pure information - Something else (template/view?) for layout and (possibly) forms - CSS for styling in terms of fonts, colors, etc. This would easily handle layouts, but it would also have some NLS-like capabilities where you could switch from one way of presenting information to another without changing the actual docment.

This was the role that XSL tried to fill but it never caught on. Part of the reason is that it's still very dependent on what information is in the source document; if it's not there you can't lay it out, and if you don't need it then it was a big waste of database time. This ends up reversing the dependency, so the contents of your "pure information" layer end up depending on what your "layout" layer needs, and in t…

XSL was not envisioned as a middle layer between HTML and CSS. Plus, it was a quintessential design by committee, trying to cater to a bunch of conflicting use cases with no overall vision or conceptual elegance.

Re: CSS Grid – Table layout is back. Be there and be square

#247
post #229
post #216

Earlier quoted context omitted.

It's very easy to declaim one or another layout system as verbose or inconsistent. Can you suggest a mainstream layout system that offers this feature in a better manner? I've used a lot of different layout frameworks over the years. Constraint systems are neat but hard to scale. All-code layout definitions are hard to read and reason about. Markup-level layout systems have their issues, but are easier for new progra…

Here's the fundamental problem with separating styling from content: styling is content. Layout matters. Layout carries semantics. Right here on HN is an example, where the comment reply chain is indicated with indentation. The meaning of a comment such as "I disagree" varies depending on what it is replying to and therefore where it is in the layout. Other examples where layout is content: Captions for photos. An on…

> You would need to express the semantic relationships within the data, like "comment-replied-to"

Like https://indieweb.org/in-reply-to ?

Re: CSS Grid – Table layout is back. Be there and be square

#248

Earlier quoted context omitted.

The content map is the dom, no? I can't see what you described ending up any less complex than what we have today.

The DOM is more than the proposed content map, because it also creates structure. I think the proposed idea is to basically create a structure without any content, then apply the content into that structure. The current split is CSS is presentation while HTML is content + structure. Unless I'm misunderstanding, this proposal would separate content and structure. I'm not sure where presentation would go; you could cer…

I'd be curious if there are any existing example implementations that you think demonstrate this - I'm having a hard time wrapping my head around how flattening the structure would make things better.

A tree node structure for mapping content seems like it'd be the most efficient in all the ways I can imagine it.

Re: CSS Grid – Table layout is back. Be there and be square

#249
post #116

Earlier quoted context omitted.

The version of CSS Grid that's supported by IE isn't the version that's in the standard and supported by all other browsers. Same with Flexbox.

Doesn't autoprefixer solve this?

It's not about vendor prefixes; MS IE implements a very old version of the CSS Grid Spec. But I guess MS will update the implementation now that CSS Grid is Candidate Recomendation. Actually, Rossen Atanassov (Microsoft) is one of the current authors of the spec.

Re: CSS Grid – Table layout is back. Be there and be square

#250
post #154
post #49

Earlier quoted context omitted.

> it should be available for 95%+ of users within a year only if you don't have enterprise customers. Those will continue to run IE11 for the foreseeable future as IE11 will remain supported in Windows 10 until 2025. While Microsoft is pushing Edge as an IE replacement, Edge is still lacking features and looks too different from IE for companies to feel comfortable pushing it to their users without retraining them.

A lot of conservative enterprise customers are pushing Chrome, managed by group policy, since new productivity apps don't work well on IE.

Also for security reasons alone!

I once sent feedback citing security as a moral hazard that someone would get fired over, as the reason IE8 needed to be ditched.

Chrome showed up a few months later, I'm guessing once they'd tested group policies and install scripts (which I think google makes very easy these days). No idea if it was because of me but it was certainly welcome

Post reply on HN