Replies: 2 comments
-
I'm all for experimenting, but it would take a lot to convince me that using css is a good idea. But the quesion of how separable code and styling can and should be is an open question. We currently split the difference where sizing is generally controlled locally whereas font/colors come from the theme (but fonts affect sizing sometimes). This was a result of my early experience and I'm reasonably happy with it so far. I think any change in this area will have to be motivated by what someone is trying to accomplish in a real application. I hear you and agree that Theme/QuickTheme doesn't quite feel right, but we are making progress and it's pushing other areas forward (like naming fonts is getting us closer to loading them at runtime), which I very much appreciate! |
Beta Was this translation helpful? Give feedback.
-
We can try out the cascade stylesheet DSL in Zig first before we try out concrete CSS syntax. CSS is essentially predicates. If <selector>, then <apply rules>. We don't have to copy CSS variable names from web land verbatim. I have commented here that the styler should be function. CSS is a predicate interpreter. Here's what the selector can match on:
About 2, is our widget system complex enough to need it? Is one font family, one border color, one [everything else] enough for a single widget? This will limit how complex widgets in dvui can be, but make the system simpler. CSS has 3: tag name (i.e. widget type), class name, id. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Related #133
I think it might be interesting to experiment with using CSS for styling. CSS is fairly simple and standardized, so it should be intuitive for most people. I got this idea seeing how waybar uses css for its styling and how simple that was.
I'm not sure I'm completely happy with the new situation of using
QuickTheme
andTheme
to decide styles, so here are some alternative thoughts for what CSS styling implementation might look like.dvui.Options
would be givencss_id: []const u8
andcss_class: []const u8
fieldsExample of the jungle theme might look implemented in css
Beta Was this translation helpful? Give feedback.
All reactions