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 settings to override theme font sizes #6926
Add settings to override theme font sizes #6926
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
I'm reasonably happy with this PR as is. Paging @ian-r-rose could you please give this a once-over? |
f607b4e
to
c176936
Compare
The major issue that needed review (how/where to validate the CSS overrides) has been resolved (by adding The PR should be good to go now. Can I please get a fellow dev to look at/sign off on this? The "Increase/Decrease X Font Size" menu items are working quite nicely (eg they're able to read a theme's default settings and start from there, they have a nice behavior if someone sets their font sizes in units of |
...and now for good measure I've added strict validation of the CSS override values (whereas the keys are handled by the JSON schema validation). @jasongrout @afshin Does my validation implementation seem reasonable? |
Is this a UX change, or an API change? If it is just a UX change, we don't consider it backwards incompatible, and it should be listed in the User-facing changes. |
Makes sense. I only changed the palette items, not the underlying commands, so that should just be a UX change. I've updated the notes in my first post accordingly. |
Code changes look good to me, I am testing this locally now. |
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 tried changing the font sizes in the settings editor using em
but it had no effect. Should this have worked?
{
// Theme
// @jupyterlab/apputils-extension:themes
// Theme manager settings.
// *************************************
// Theme CSS Overrides
// Override theme CSS variables by setting key-value pairs here
"overrides": {
"ui-font-size1": "3em",
"code-font-size": "14px",
"content-font-size1": "2em"
},
// Scrollbar Theming
// Enable/disable styling of the application scrollbars
"theme-scrollbars": true
}
I think I know where the |
@blink1073 Hmm, now I can't reproduce your trouble with the I copy/pasted the settings you provided, and then inspected the CSS of a filebrowser item in devtools. The |
Ah, crud. It's another set of these bugs. I just tested the PR again in Firefox, and now I see exactly what you mean, @blink1073 And now I'm kicking myself for not testing out the font size changing stuff in multiple browsers. The old scrollbar theming stuff, which is basically being re-used as is, was tested in multiple browsers, so it's weird that that broke. |
I was validating the font size values against the CSS I tested a fix on Chrome/Firefox/Safari and pushed it. In Firefox, the scrollbar theming is partially broken: only the horimzontal scroll bar will change color correctly. Some CSS stuff might need some freshening up. |
hopefully this fixes the failure of the Linux Integrity CI
…rrectly the default theme override keys weren't showing up in the last commit. For some reason rearranging the JSON fixed it.
`apputils-extension/src/index.ts` was getting crowded, so I also split out the theme plugins into their own source file
d195967
to
997b4fe
Compare
@blink1073 All of the issues you found should now be fixed, so give the PR another test. The bugs were partially due to a rotten CSS selector, and partially due to the differences between CSS handling in specific browsers. This raises the question of how to write tests for the theming settings stuff, but that can be another PR |
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.
Works well in Firefox and Chromium on Linux Mint. Thanks!
This will go into the next RC, which I plan to cut tomorrow. |
References
#6908
telamonian/theme-darcula#4
Since I released a theme a while ago, I have heard a number of very strong opinions about what the correct size is for various fonts. Since there's clearly no one best solution, I think it's about time we added some general font size settings.
Code changes
Various minor changes to
ThemeManager
and related code.User-facing changes
There are now settings for changing the font sizes, and corresponding items in the
settings
menu and thetheme
palette category. These settings override the font sizes present in the themes. For good measure, I also added items for toggling the scrollbar theming.Moved theme-related palette items from
Settings
category to newTheme
category.Backwards-incompatible changes
None