-
Notifications
You must be signed in to change notification settings - Fork 4
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 broken icons #1768
Fix broken icons #1768
Conversation
- fixes broken icons across the site - icons are glyphicons from bootstrap, which are included as part of that dependency and can't be directly modified - problem is caused by the compiled Sass not being able to find and download the icon font files e.g. https://content-tagger.publishing.service.gov.uk/assets/content-tagger/bootstrap/glyphicons-halflings-regular.eot - this appears to be because the syntax in bootstrap for defining these files uses `url(font-path(path))` which doesn't seem to work anymore, could be related to the recent dart-sass migration but unclear - as a workaround have copied the font-face declaration from the bootstrap CSS into our own, and replaced the above with `url(path)`, which works - this occurs after the bootstrap declaration, overriding it and allowing the icon font file to be found and loaded correctly
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.
Looking at integration, this seems to have fixed some of the icons, but not all of them. For example looking at this page I can see that the double-headed arrow on the right of the drop down now appears, but the X on the left hand side still does not:
3685e47
to
a4b6a86
Compare
- these icons appear on the edit a page page and should be on the left of things that can be added or removed from a page - can't be fixed by the previous change as this isn't a glyphicon, for some reason, is part of a dependency so can't directly modify the now not-compiling-in-dart-sass image page - easiest thing is to switch to a glyphicon instead - adding some custom styles to position it properly, have to make it this specific as there's an override to float all glyphicons in this element to the right, where there's already an icon - also adding a JS class for the JavaScript hook
Think I've fixed all the icons now. Unfortunately they're mostly in external dependencies, which aren't fully compatible with the new dart-sass compilation, meaning we can't access that code to fix it. I've had to add some unfortunately quite specific overrides in our our Sass, the problem is around background images originally written using |
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.
LGTM—great work figuring this out!
- relying upon glyphicons as part of bootstrap, but the Sass for that doesn't compile properly in dart-sass because it uses `url(font-path(path))` - instead copy the font-face declaration from bootstrap into our code, overridding the original with this one, which fixes the icon paths and the icons - see similar problem fixed in content-tagger: alphagov/content-tagger#1768
What / why
url(font-path(path))
which doesn't seem to work anymore, could be related to the recent dart-sass migration but unclearurl(path)
, which worksVisual changes
Before
After
Trello card: https://trello.com/c/gW2NW1sB/239-fix-sass-compilation-warnings