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 support for CSS-based theming on the canvas #13828
Conversation
e05ba19
to
5c6614a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## branch-3.5 #13828 +/- ##
==============================================
+ Coverage 91.57% 92.62% +1.04%
==============================================
Files 326 326
Lines 20737 20767 +30
==============================================
+ Hits 18990 19235 +245
+ Misses 1747 1532 -215 |
b0f9a3a
to
9bcbdfb
Compare
This is tentatively ready for review. There is a class of failures (resulting in multiple integration test errors) that I'm fighting with, which a side effect of bad design around |
Approved with some minor inline comments. Some other general comments:
Does the generated DOM hierarchy include the model names, so that those could be used as selectors in some way? A purely type based option is a bit limiting if users want to style different axes on different plots, say. Lastly, I guess the specificity of e.g. |
That specificity is there by design, because those classes are added for ease of identification of DOM components and thus ease of debugging. They are not meant for user consumption and they really can't be used for styling, because shadow DOM would prevent users from attaching any global or global-ish styling using those classes (this is why we are migrating to using CSS variables). |
9bcbdfb
to
e228941
Compare
* rendering is for constructing DOM nodes * painting is for drawing to the canvas
e228941
to
960557d
Compare
960557d
to
6e709ed
Compare
6e709ed
to
cf8dc3e
Compare
This PR:
An example showing CSS styling of plot background and axis background, ticks, labels and line (see
examples/styling/visuals/css_variables.py
):Having an associated DOM hierarchy will aid debugging on the canvas, as well as set up ground work for accessibility/ARIA support and perhaps fully CSS-based layout in the future:
Performance implications of the DOM hierarchy should be negligible.
HTMLLabel
to supportstylesheets
andcss_classes
#13652