Live data from Hacker News

Faster Layouts with CSS Grid and Subgrid

hacks.mozilla.org

81–86 of 86 posts

Re: Faster Layouts with CSS Grid and Subgrid

#81

Earlier quoted context omitted.

While I agree with almost everything you said, did you need to be condescending while doing it?

These is value to vehemence in arguments.

`s/vehemence/passion/` and I might have agreed. The words may be similar, but there is a distinct difference between them. Had OP just showed passion for the topic without being vehement, I think it might have landed a lot better.

Re: Faster Layouts with CSS Grid and Subgrid

#82

So I'm working on a replacement for HTML and CSS. Right now it's written in JavaScript and it renders to canvas. The reason I'm posting here is because you can write your own layout components in my system. So if you have a new idea, instead of waiting years for it to get standardized and supported by the browsers, you can just roll your own idea and run it in anywhere without any fuss. (Flexbox took years to do some…

JavaScript is like the worst alternative to HTML and CSS when it comes to performance, dependencies and accessibility.

Why do you believe that is the case? And what can be done to change that situation for the better?

Finally, why is JavaScript so popular? Why is driving the fact that more and more of the web getting rebuilt in JavaScript?

Re: Faster Layouts with CSS Grid and Subgrid

#83
post #66

Earlier quoted context omitted.

Oof. You are definitely missing the entire point of CSS Grid. CSS Grid is a two dimensional layout tool. Flexbox is one. CSS Grid is for architectural layout. Flexbox is for alignment and flow layout. CSS Grid was enabled across all major platforms by October 2017. You've had two years to figure that out. You want it on IE? Then use CSS Grid's original syntax because Microsoft supported Grid first . The browsers have…

While I agree with almost everything you said, did you need to be condescending while doing it?

My thoughts exactly. Let’s all be adults here.

Re: Faster Layouts with CSS Grid and Subgrid

#84

Earlier quoted context omitted.

JavaScript is like the worst alternative to HTML and CSS when it comes to performance, dependencies and accessibility.

Why do you believe that is the case? And what can be done to change that situation for the better? Finally, why is JavaScript so popular? Why is driving the fact that more and more of the web getting rebuilt in JavaScript?

Primarily because JavaScript was the only language provided via browsers for dynamic scripting, so they didn't have to compete or care that much about performance optimizations. Also, browsers have become bloated virtual machines that try to cater to companies that want to track things like mouse and keyboard activity, rather than user privacy and consistency for uniform experiences.

JavaScript is so popular because a majority of developers started with with web development, and a majority of the money flowing into development was/has been focused on gathering user information and pushing ads for additional revenue, not delivering quality content using a consistent interface.

Re: Faster Layouts with CSS Grid and Subgrid

#85
post #48

Earlier quoted context omitted.

They have different use cases. The rule of thumb is to use Flexbox if you're laying out content along the X or Y axis and Grid if you need to lay it out over both the X and Y axes.

That's an okay rule of thumb, but I find myself using grid more and more for traditional flexbox applications like a horizontal list of cards that wraps. Little things like grid-gap (flex child margins are a constant source of pain) and auto-fill with minmax [0] make a big difference to me in rapid prototyping. [0] eg: grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));

Firefox supports grid-gap for flex, but I no other browsers do yet.

https://caniuse.com/#search=gap

Re: Faster Layouts with CSS Grid and Subgrid

#86

Earlier quoted context omitted.

JavaScript is like the worst alternative to HTML and CSS when it comes to performance, dependencies and accessibility.

Why do you believe that is the case? And what can be done to change that situation for the better? Finally, why is JavaScript so popular? Why is driving the fact that more and more of the web getting rebuilt in JavaScript?

> Why do you believe that is the case? And what can be done to change that situation for the better?

The current HTML/CSS rendering is currently done by the browser. That part is native which means it can benefit heavily by the resources available that way (usage of the CPU/GPU, direct access to memory, etc...). It's also made by a bunch of people, with years of experience in the domain, they can make all this

Your solution would put this all on the Javascript side, which is already often put to its limits with our current usage.

React seems like a better solution. It render directly to HTML/CSS, so it profit from the browser performance to render it, but you can replace the rendering with something else (like React Native).

Post reply on HN