3 ms·
This project looks very useful at a glance. Create native applications that use the widely popular HTML/CSS paradigm for layout, but leave out much of the heav
by dgb23 2y ago
This project looks very useful at a glance.
Create native applications that use the widely popular HTML/CSS paradigm for layout, but leave out much of the heavyweight stuff that a full JS/DOM/browser API implies. This looks like it can enable very large improvements over packaging browser engines like electron etc. do.
Funnily enough, I just recently listened to Casey Muratori on Richard Feldman‘s podcast, where they where extremely critical of CSS.
Some of the stories they told, like having to prerender and dynamically measure web pages in order to achieve some very simple layout relationships hit right at home.
Writing CSS feels, as Muratori said, more like presenting a case in the court of law, instead of building upon simple primitives.
Now there’s of course a very widespread need or want that is met by this project. Not just in terms of familiarity but also compatibility and the fact that „happy path CSS“ is incredibly productive.
But maybe there’s an opportunity to provide a simpler, general layer that a user of this can drop down to.
Perhaps the authors can find inspiration by looking at CSS houdini, which tries to make CSS extensible via a JS API. Or maybe that’s what they mean by „Custom Widgets“?
- philistine 2y agoWe need a strict CSS that removes the cruft and promises improvements in performance. I don't know why the browsers haven't offered it yet. Like just remove float.
- MrJohz 2y agoFloat is necessary for some layouts, particularly documents where you might have a lot of text that wraps around a handful of images. I don't believe it's possible to implement that without floats (at least not without some clever shenanigans). I think most attempts to simplify CSS are going to fail in this way. Almost all of CSS right now is useful for something or other — there's actually not a huge amount of cruft in there (in comparison to, say, JS, where a lot of built-in APIs and functions should not be used, or need to be used in the right way). It's just that CSS gets used for everything from applications (where grid/flex are mostly enough) through to documents (where floats and tables become more important).
- littlestymaar 2y agoYeah the problem with CSS comes from its weird design with many implicit rules (border collapse, block formatting context, and hundreds of other quirks), but not from the fact that it's “bloated”. So if you want to address CSS's problem, they must: - invent a more coherent and easy to use styling language - implement a GPU-accelerated renderer - write tons of documentation to make sure people will find how to use it No wonder why people stick with CSS for everything nowadays even if the consensus is that it's a really annoying tool to work with.
- philistine 2y agoMy point is that this language could be built on a foundation of CSS. Like don't implement the flow model, just implement box. Change how all the border collapses and block formatting work, but keep CSS as the language. I mean they should even change the order priority to make it fit with typical conventions.
- nicoburns 2y ago> Create native applications that use the widely popular HTML/CSS paradigm for layout, but leave out much of the heavyweight stuff that a full JS/DOM/browser API implies. This looks like it can enable very large improvements over packaging browser engines like electron etc That's pretty much the pitch! > Some of the stories they told, like having to prerender and dynamically measure web pages in order to achieve some very simple layout relationships hit right at home. > Writing CSS feels, as Muratori said, more like presenting a case in the court of law, instead of building upon simple primitives > Perhaps the authors can find inspiration by looking at CSS houdini, which tries to make CSS extensible Pluggable layout algorithms are definitely something I'd like to enable in Blitz. I suspect JS for layout will be too slow in most cases. But this is an area in which we have an advantage with our API being in Rust. And our layout engine Taffy (https://github.com/DioxusLabs/taffy https://github.com/DioxusLabs/taffy) is already highly modular. Custom widgets would go beyond just layout and allow for fully custom layout, paint, accessibility, event handling, etc similar to a widget in a traditional GUI toolkit like GTK or Cocoa. I also have a proposal to add a new unit to CSS itself (inspired by how many non-web UI systems do layout), which has the potential to greatly simplify web layout in the common cases https://github.com/w3c/csswg-drafts/issues/8267 https://github.com/w3c/csswg-drafts/issues/8267. It's been on the back burner for a bit, but I should really get back to it at some point (I really want to actually implement the algorithms).
- nickpsecurity 2y ago“ Create native applications that use the widely popular HTML/CSS paradigm for layout, but leave out much of the heavyweight stuff that a full JS/DOM/browser API implies. This looks like it can enable very large improvements over packaging browser engines like electron etc. do.” Like an improved Dillo? https://en.m.wikipedia.org/wiki/Dillo https://en.m.wikipedia.org/wiki/Dillo I’d be interested in something like that for simple, web browsing or apps. Sciter was the only one I knew about. It was proprietary but had innovative licensing.