-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#1059] Added support for SVG logos #532
Conversation
207f6e4
to
d1ee860
Compare
d1ee860
to
5d0cfe9
Compare
@jiromaykin I'm not 100% sure if the CSS changes are OK, as you explicitly added those Note I also needed to set a height-attribute on the SVG's image element for it to show up, but then that would break the non-blurry-images for regular pixel images so I made it adaptive. I got some SVG's from here: https://www.cityofenschede.com/en/brand (particularly the wide logo) |
OK @Bartvaderkin - i needed those heights for mobile, in order to not prevent the images stretch/shrink really weirdly - but i will check to see what happens with SVG's and other images. And... maybe different thing happens if the user uploads SVG's that have an inline style? |
@@ -1,13 +1,9 @@ | |||
.logo { | |||
&__image { | |||
max-width: 100%; |
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.
This seems completely fine actually - I've done some really weird testing with strange SVG's and the only SVG's that do not behave well are the ones with inline-styling and without an explicit viewbox
- so: if users upload correct and valid SVG's then the styling behaves well (something to note for ourselves in case future users report problems with SVG).
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.
Ugh yes invalid or weird SVG's are a complication. The SVG used should at least look normal in a browser/viewer without margins (viewbox and transforms etc)
Note I had to update some dependencies to get SVG support in django-filer