CSS-like styling
Some half-finished ideas around how to improve the styling and theming story for egui. # Background Styling for egui is currently supplied by `egui::Style` which controls spacing, colors, etc for the whole of egui. There is no convenient way of changing the syling of a portion of the UI, except for changing out or modifying the `Style` temporarily, and then changing it back. We would like to have a system that can support CSS-like selectors, so that users can easily style their ui based on the *Style Modifiers* (see below): It would be very beneficial if such styling could be set in a single text file and live-loaded. # Action plan * [x] https://github.com/emilk/egui/issues/3936 * [x] https://github.com/emilk/egui/pull/4232 * [x] https://github.com/emilk/egui/issues/4019 * https://github.com/emilk/egui/issues/7586 * [x] Implement a first iteration of `StyleModifiers` ("classes") * [ ] Implement the `WidgetStyle` selection it via a plugin system (`ThemePlugin`). * [ ] Cache the output of the `ThemePlugin` * [ ] Implement some hierarchical "class" system and add that as part of `StyleModifiers` * [ ] The actual CSS rule engine, which can now be fully a separate crate, and opt-in # Proposal ## Style modifiers Here are some things that could influence the style of a widget: - widget type (button, slider, label, …) - interact state (disabled, inactive, active, hovered, active) - text modifier (header, small, weak, strong, code, …) - per-`Ui` class (”settings_panel”) - p
Posted by emilk on Aug 28, 2023, 3:00 PM
Tags
Related issues
- This is the biggest problem with contracts, there's simply no way to actually say "please always execute this check".
- I don't disagree with you on this, I worked my whole life in corporate and haven't worked as a OSS maintainer before, though I will _and ...
- the new VSCode UI, looks cute, i don't like it.
- I've been working on my own private harness for the past 8 months, and I've been collecting ideas from such repos I've stumbled upon.
- The way AI is able to interact with outside resources is pretty impressive, but the quality of code it produces to me is still questionab...
- Add PR-style review comments in Git Diff UI that feed into the active agent thread
Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments
ux (Software)
This is the biggest problem with contracts, there's simply no way to actually say "please always execute this check".
I don't disagree with you on this, I worked my whole life in corporate and haven't worked as a OSS maintainer before, though I will _and ...
the new VSCode UI, looks cute, i don't like it.
I've been working on my own private harness for the past 8 months, and I've been collecting ideas from such repos I've stumbled upon.
The way AI is able to interact with outside resources is pretty impressive, but the quality of code it produces to me is still questionab...
Add PR-style review comments in Git Diff UI that feed into the active agent thread
Thanks for indulging me so far, by the way, I really appreciate this discussion, it's very stimulating.
Migrate GDScript to the GDExtension mechanism and overhaul the implementation
CSS-like styling
Some half-finished ideas around how to improve the styling and theming story for egui. # Background Styling for egui is currently supplied by `egui::Style` which controls spacing, colors, etc for the whole of egui. There is no convenient way of changing the syling of a portion of the UI, except for changing out or modifying the `Style` temporarily, and then changing it back. We would like to have a system that can support CSS-like selectors, so that users can easily style their ui based on the *Style Modifiers* (see below): It would be very beneficial if such styling could be set in a single text file and live-loaded. # Action plan * [x] https://github.com/emilk/egui/issues/3936 * [x] https://github.com/emilk/egui/pull/4232 * [x] https://github.com/emilk/egui/issues/4019 * https://github.com/emilk/egui/issues/7586 * [x] Implement a first iteration of `StyleModifiers` ("classes") * [ ] Implement the `WidgetStyle` selection it via a plugin system (`ThemePlugin`). * [ ] Cache the output of the `ThemePlugin` * [ ] Implement some hierarchical "class" system and add that as part of `StyleModifiers` * [ ] The actual CSS rule engine, which can now be fully a separate crate, and opt-in # Proposal ## Style modifiers Here are some things that could influence the style of a widget: - widget type (button, slider, label, …) - interact state (disabled, inactive, active, hovered, active) - text modifier (header, small, weak, strong, code, …) - per-`Ui` class (”settings_panel”) - p
Comments (0)
No comments yet. Start the discussion.