-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Themes and command palette improvements #5087
Conversation
### Dark mode | ||
## Light and dark themes | ||
|
||
Themes can be either "light" or "dark". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the quotes may confuse there. It suggests that they are strings.
Maybe something along these lines?
Themes may be marked as being light or dark.
reference/_color_system.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
@@ -698,17 +703,17 @@ class Markdown(Widget): | |||
| :- | :- | | |||
| `code_inline` | Target text that is styled as inline code. | | |||
| `em` | Target text that is emphasized inline. | | |||
| `s` | Target text that is styled inline with strykethrough. | | |||
| `s` | Target text that is styled inline with strikethrough. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda liked the original spelling better.
I spotted that the unselected crosses in the I'm also finding it a bit difficult to make out the scrollbar on the screen in light mode, but maybe that's just to my eyes! Especially in 256-color terminals where the thumb barely distinguishable . Hope you don't mind my late feedback, I realise this has already been merged... |
Thanks Tom, we're doing another pass now before releasing this. Tweaking scrollbars now, but didn't notice the issue with the SelectionList - will get that sorted too. Cheers! |
@TomJGooding cheers - working on SelectionList, RadioSet and ToggleButton now! Will try to make them consistent on light themes. |
Sorry will leave this now in your capable hands! This is a fantastic feature and I can see the work that's gone into it, hopefully you don't think I'm just nitpicking. |
No no, not at all! We appreciate it. This was so much ground to cover and I definitely missed a few things. If you find anything else that you think looks off please let us know :) |
App.dark
App.theme: Reactive[str]
which can be used to set the theme (registered themes only).variant
parameter toLabel
(success/primary/accent/error, etc.)InvalidThemeError
, raised when an unregistered theme is set.App.get_theme(theme: str) -> Theme
App.register_theme(theme: Theme)
App.unregister_theme(theme: Theme)
App.theme_changed_signal: Signal[Theme]
.App.available_themes -> dict[str, Theme]
CommandPalette
to be instantiated and pushed by users, with arbitrary providers and a custom placeholder per-instance.SimpleProvider
which allows a caller to pass commands into a CommandPalette rather than having a provider be aware of where it might be invoked (experiment).App.search
, a shorthand for the above that lets you quickly invoke a searchable menu with a list of commands, e.g.self.app.search([("copy", self.copy), ("paste", self.paste)]
(an experiment - creating a separate provider each time feels like a big overhead and the providers need to query the active screen etc.)App.search_themes
which pulls up a command palette containing all registered themes. This is what is called when you select "Change theme" in the command palette.$hover
,$cursor-highlight
,$cursor-highlight-blurred
,$hover-highlight
,$hover-highlight-blurred
.textual-themes-3oct24__89pct_smaller.mp4
Widget borders
I tried removing the widget borders and although I do think they look better in isolation, when they touch each other there's no way to distinguish between them:
I opted to keep the border but make it very subtle:
Background tint
The majority of builtin widgets now get a subtle background tint when focused e.g:
This is particularly useful for users who prefer compact styles and remove borders and therefore don't receive the "focus styling" that gets applied to borders.