Needs work
Project:
Drupal core
Version:
main
Component:
Umami demo
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2023 at 14:13 UTC
Updated:
12 May 2023 at 08:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
markconroy commentedComment #3
Harish1688 commentedHi,
Based on the problem ticket, an approach has been devised to address the issue of setting the background color for SVG images using CSS.
1. The proposed solution ensures that the background color of all icons is not conflicting with each other. This can be achieved by utilizing CSS variables to modify the background image color.
file path : core/profiles/demo_umami/themes/umami/css/components/content-types/recipe/recipe.css
remove code this:
replaces by this:
Comment #4
aaron.ferris commentedComment #5
smustgrave commentedThis needs an issue summary update before reviewing.
Thanks
Comment #6
Harish1688 commentedComment #7
Harish1688 commentedsummary update, now moved to needs review.
Comment #8
mherchelFYI, we're using the
maskproperty in a similar way in Claro to make sure the icons support forced-colors mode.The method above works in all of Drupal's supported browsers. If we do this, we can also add a forced-colors media query to make sure it works properly there. So if we have something like
We'd just need to add
Comment #9
markconroy commentedInteresting approach @mherchel.
I'm not fully sure if we need to "fix" this issue since Umami has a set design and the colours are set in the SVGs. It only became an issue because one of the people working on the MR wanted to declare the CSS variables inside the SVG - which would mean the same variables declared in CSS and then multiple times in SVGs, which doesn't look very DRY to me. Instead, I decided we'd leave the Umami SVGs as they were and create this follow-up IF we needed it.
My preference would probably be to inline the SVGs instead of working with CSS workarounds, and then we could use whatever CSS we wanted to to add the colours for them.
Moving this to "Needs work" instead of "Needs review" since there is no actual code to review.
Comment #10
markconroy commentedUpdating issue summary to remove