Problem/Motivation
This is annoying because Lighthouse and similar tools are complaining, and yeah images should have width and height attributes.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | site-logo-width-height-3218479-9.patch | 2.65 KB | pivica |
| #9 | interdiff-8-9.txt | 1.32 KB | pivica |
Comments
Comment #2
pivica commentedHere is a patch that is adding width and height for all image types except SVG.
Comment #3
pivica commentedComment #4
pivica commentedForgot to add changes for the related template.
Comment #5
berdirI'd add a file exists check to be extra careful.
Comment #6
pivica commented> I'd add a file exists check to be extra careful.
Something like this?
Does it make sense maybe to introduce logo_attributes variable instead of manually rendering attributes in template for this part:
Comment #7
pivica commentedThis manual attribute rendering is quite tricky because of the auto escaping of quotes in twig. I've added the logo_attributes variable instead, as mentioned in the previous comment.
Comment #8
pivica commentedBased on discussion with @berdir we will also keep the old site_logo_alt_text variable so a custom theme that is using this variable in overridden templates will still work.
Comment #9
pivica commentedThis changes introduced a bug that needed CSS class `site-logo` is not applied for SVG logo that is not inline which produce layout problems for mobile clients. Should be fixed in new version.
Comment #11
pivica commentedCommitted.