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
Fix legacy support for icons-as-css-background #7947
Fix legacy support for icons-as-css-background #7947
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
Is this needed in 2.0? |
In theory there shouldn't be any user visible problems. Actually, it might be even less of a problem than that. I think it's been pretty common for people to have set up their own style classes to go along with their icon classes. Here's an example from the geojson-extension:
|
So I guess I'd say it should go in, but only if it doesn't significantly delay us cutting the final release |
@blink1073 - your call, then, since you are planning to cut the release tomorrow. |
Maybe this could be listed as part of the migration guide indeed. That sounds like a reasonable option for now, although it would be nice to have this fix in 2.0.x or 2.x. |
I've fixed/tested legacy icon support for:
I think that covers all of the places where an icon passed into core by an extension can get used |
@saulshanabrook I believe this was included as part of the 2.0.0 release, not a 2.1.x release |
Ah thanks for the catch max! |
References
#7887 (comment)
jupyterlab/extension-examples#70 (comment)
All interfaces that had an
.iconClass
field now also have an.icon
field. Ificon
is undefined andiconClass
is a non-empty string, the interface in question will fall back to the old icon behavior: instead of rendering an svg inside of a container, it will simply setclass=iconClass
on the container.However, as spotted by @jtpio, the legacy icons-as-css-background weren't showing up. It turns out that although the DOM was being set up correctly, the icon styling is no longer set up to correctly display background images (eg
background-size
was unset).Code changes
Added/fixed up some icon-related CSS classes, and made some small tweaks to the icon stylesheets. All legacy icons should now show up correctly.
User-facing changes
Icons-as-css-background should now all be visible. The PR also includes a fix for the coloring of Blueprint icons (currently only used in a "search" icon in the search bars of the extension manager and the json document widget)
Backwards-incompatible changes
NA