-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
Add Design and Theme explanation documentation #4741
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4741 +/- ##
==========================================
- Coverage 82.69% 73.21% -9.48%
==========================================
Files 301 268 -33
Lines 45099 37681 -7418
==========================================
- Hits 37293 27589 -9704
- Misses 7806 10092 +2286
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
doc/explanation/styling/design.md
Outdated
# Designs and Theming | ||
|
||
:::{versionadded} 1.0.0 | ||
Designs and theming allow controlling the look and feel of individual components or your entire application. |
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.
Maybe connect to template too. For me I think I want to correct a template, so I'm looking for an explanation for that.
So I probably need to be taught that the starting point is a design. A design can have different themes. And a template can use the design (and theme).
Maybe even visualize how these things are connect via a graph. Or via an a screenshot of an app wrapped in a nice template that uses some design.
All these design stylesheets open with CSS variable definitions which map the global color definitions to specific variables used by a particular design system: | ||
|
||
```css | ||
:host, :root { |
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.
You will need to explain what :host and :root refer to.
Its a good starting point for me. I added my questions and comments. I hope we can use that to improve the PR. |
Indeed, only a start, all good points in your review. |
One thing I need to do is to change for the What I've been trying is to add some selector to the file https://github.com/holoviz/panel/blob/main/panel/template/fast/fast.css For example div.bk-right.bk-active {
border-left-color: yellow;
}
:root, :host {
--active-tool-highlight: green !important;
}
:host(.bk-right.bk-active){
--active-tool-highlight: salmon !important;
}
.bk-right.bk-active {
--active-tool-highlight: pink !important;
} The only selector that seems to get near is ContextPre Panel 1.0/ Bokeh 3.0 we could change the tool button border and the tooltips color via the this css. I would like to achieve the same effects for Panel 1.0 to beautify the Bokeh plots. |
Any component in the shadow DOM cannot be styled from the template CSS file. As laid out in the document those rules have to go in panel/theme/css/fast.css |
--active-tool-highlight: var(--theme-active-tool-highlight, #26aae1); where :root {
--theme-active-tool-highlight: red; /* or var(--another-themed-variable) */
} Note that |
@mattpap Thanks for the explanation, unfortunately in this case I can't see how we'd even go about injecting anything into the shadow DOM of the tool button, as far as I can tell the tool button does not have a corresponding Python model that we could inject the stylesheets on. |
Is it correctly understood that currently we cannot style the tooltip and toolbar buttons? |
Waiting to hear back from @mattpap but to me it looks like that. The tool buttons are internal models so can't easily be controlled from Python. IMO all tool related CSS variables should therefore be set at the toolbar level not at the tool button level. |
Each button is an individual component and then toolbar is another component. Tool buttons are exposed in bokehjs, but not it Python, because I couldn't settle on a stable API before 3.1 release. |
What would the next step be here @philippjfr ? A feature request to Bokeh? |
Yes, absolutely. That said I'm not entirely sure what shape that would take. I don't really see how we can expose |
7fa76ac
to
a3b3037
Compare
I haven't addressed all review comments but this is already much better than nothing. |
I feel the same for the |
Yes, indeed. Was planning to do that. |
* Add Design and Theme explanation documentation * Address a few review comments
@MarcSkovMadsen This is definitely far from perfect but I'm hoping it'll give you an idea of how to contribute to improve the Fast designs (and restore some of the styling that didn't get ported).