Open willmcgugan opened 1 month ago
Some ideas and a bunch of questions that would be good to chat about:
App.theme_name (str)
reactive which is set to the theme name.App.theme
read-only property which gets the "theme object"?App.register_theme(theme: Theme)
which allows "registering" a theme. A registered theme will appear in the command palette and is just stored in a dict at the app level.
Theme
object or expose ColorSystem
(possibly rename to Theme
?).
ColorSystem
object is really convenient because it "fills in the blanks" nicely when values are missing. In Posting, you can define a theme with just a couple of colours and it still looks reasonable thanks to the ColorSystem. Users could provide values for primary
, secondary
, etc...App.theme_changed
reactive of type Signal[Theme]
. Rich renderables don't easily have access to colours from the theme, and when the theme changes they need to be able to refresh themselves to grab the new values from the theme. (Perhaps this should be handled entirely by component classes though?)Q - How should this interact with App.dark
?
Posting has no concept of "dark mode" vs "light mode". It just has themes. Should App.dark
become something like App.theme = "textual-dark"
? The problem was that colours pretty much always needed tweaked when put against a light background vs a dark background.
I'm also worried that enforcing "if you design a theme then you need to make sure it has a light variant" isn't ideal.
Looks good. A Theme
object should be conceived to also support future extensions, like more tcss variables to more properly customize widgets default appearence (button border style and width, but also progress block characters come to mind for example)
About dark mode, in addition to map it to textual-dark
, IMHO I'd deprecate it entirely with a clear note both in the docs and at runtime in the dev console.
This might be a convenient way to bundle up a set of styling changes for Linux console support. I think I have boiled the dominant issues down to two points:
We need a system to allow customization of styles, and enforce a consistent look and feel.
Something inspired by Posting...