Hacker News new | ask | show | jobs
by citizenpaul 543 days ago
I'm not a frontend person. Can anyone explain why this is better than using CSS directly or a CSS framework/library? Seems like added complexity when there are already hundreds of CSS frameworks available that seem like they do the same thing.
4 comments

This isn't really meant to replace such things an environment where you have a rendering engine that supports CSS— I think demoing it on the page is more for showing off how portable it is with WASM. Off the top of my head, a few uses for this:

- Mapping components or structured document data with something like MDX or slate on to Clay components to render in different contexts outside the browser reasonably closely to what shows up in a browser preview, for example content for HUDs, in-world display panels or documents in games, or batch rendering printed documents

- Layout for UI where something like Electron or React Native would be overkill, or isn't supported

Maybe you want the compile some C to wasm and render to canvas. Then it's pretty neat.
The main goal is to enable nice UI without the requirement of a whole web browser in order to get CSS. The fact that it can be used to layout web pages is just showing off to get the attention of the billion web devs out there.
This UI library can be re-targeted to Raylib, Canvas, HTML from its markup ... Good luck doing that with just CSS.

Put another way, this library is a step into writing an agnostic UI layer for your application which it just invokes from its business logic. If you can decouple your UI from your application code ala MVC or MVP architecture, as a developer you can find the right tool for the components that compose the sum of your project.