Textualize / textual

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
https://textual.textualize.io/
MIT License
25.79k stars 799 forks source link

Theming and style language #5078

Open willmcgugan opened 1 month ago

willmcgugan commented 1 month ago

We need a system to allow customization of styles, and enforce a consistent look and feel.

Something inspired by Posting...

darrenburns commented 1 month ago

Some ideas and a bunch of questions that would be good to chat about:

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.

amottola commented 1 month ago

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.

jsatchell commented 1 month ago

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: