Vendor a glyphicons-only stylesheet instead of the full Bootstrap 3 base - #2257
Open
adarshsm wants to merge 1 commit into
Open
Vendor a glyphicons-only stylesheet instead of the full Bootstrap 3 base#2257adarshsm wants to merge 1 commit into
adarshsm wants to merge 1 commit into
Conversation
folium loaded netdna's bootstrap-glyphicons.css for the Awesome Markers glyphicon font. Despite its name that file is a full Bootstrap 3 base stylesheet: alongside the @font-face/.glyphicon rules it ships a normalize reset and global body styles (font, colour, background, margin). Loaded after Bootstrap 5, those body rules leaked onto the host page and, e.g., mispositioned user-added Bootstrap 5 components (python-visualizationGH-1820). Ship a vendored folium/templates/glyphicons.css with only the @font-face and .glyphicon/.glyphicon-* rules (fonts served from jsDelivr), referenced the same way as leaflet.awesome.rotate.css. Icon(prefix="glyphicon") markers keep working; the page-wide body/reset pollution is gone. Closes python-visualization#1820
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1820. Thanks @hansthen for the steer.
folium loads netdna's
bootstrap-glyphicons.cssfor the Awesome Markers glyphicon font. Despite the name, that file is a full Bootstrap 3 base stylesheet — alongside the@font-face/.glyphiconrules it ships a normalize reset and globalbodyrules (font, colour, background,margin). Loaded after Bootstrap 5, thosebodyrules leak onto the host page and, for example, mis-position a user-added Bootstrap 5 modal (the original report).This vendors
folium/templates/glyphicons.csscontaining only the@font-faceand.glyphicon/.glyphicon-*rules (fonts served from jsDelivr), referenced the same way as the existingleaflet.awesome.rotate.css.Icon(prefix="glyphicon")markers keep working exactly as before; the page-widebody/reset pollution is gone.Not a customer-facing change — glyphicon markers are unaffected; the only difference is that folium stops overriding the host page's
bodystyles. Added a regression test asserting the vendored file is used and the netdna URL is gone.