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
Post LabIcon cleanup; migrate last holdouts to LabIcon; fix icon styling #7864
Post LabIcon cleanup; migrate last holdouts to LabIcon; fix icon styling #7864
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
Progress update: AFAIK, all icon issues are now fixed in this PR. If you spot differently, please tell me. Two exceptions:
Getting submenus to render icons correctly took some true hackish weirdness in jupyterlab/packages/ui-components/src/icon/menusvg.ts Lines 44 to 69 in 440cb6a
|
- also added some stuff to .prettierignore, etc to protect my ide files (esp local history in `.history`) from the linters
- `elementSize` can be set to eg 'normal' for standard 16px x 16px icon
@blink1073 @jasongrout I think this PR is now ready to go in, and should fix all of the currently outstanding icon issues. There's one small breaking change now: I removed |
dd9a3d3
to
e6a179f
Compare
- bug could have caused a cached stylesheet to be incorrectly reused
I did an audit of the remaining icon-related CSS code left in the codebase. There are currently exactly 5 icons that are still being rendered using the old icon-as-css-background behavior:
The datagrid scrollbar icons will probably require some more fixes in lumino. In any case, migrating these particular icons to LabIcon isn't a high priority. Since they are all shown on top of a fixed color background (that doesn't change with the theme), their appearance should be correct in all themes regardless of rendering method |
I did another pass of the code and tested it on binder, looks good, thanks @telamonian! |
References
fixes #7859, #7869, #7887
This PR has two goals:
Fix up remaining weird edge case uses of LabIcon and remove allLabIcon.UNSTABLE_foo
methodsmigrate remaining holdout icon-as-css-background cases to LabIcon (the menu icons (see Some icons look "dimmer" with the Dark Theme in 2.0 #7859) and a handful of others (like the log console icon, I think?))Fixing the above also involves some changes to lumino, so this PR includes a bump to lumino deps.
Also, some needed fixes for the icon styling system ended up involving some minor API breaking changes (some deprecated cruft was removed from a couple of function sigs, see below). So now this PR also includes a significant cleanup of icon styling code (see
ui-components/src/style/icon.ts
). The big news from that is that now users will be able to specify their own custom icon styling much more freely/completely than before.Code changes
A lot
User-facing changes
No more visible icon regressions
Backwards-incompatible changes
I deprecated/removed
RendererClass
fromLabIcon.IOptions
(which is used as the type of the args forLabIcon.constructor
).RendererClass
was part of a now-removed renderer mixin scheme for LabIcon, and was redundant/confusing wrt some of the other fields inLabIcon.IOptions
.