The discussion revolves around setting the color of an element based on the selected color scheme. agf1997 wants to adjust the color property of .d-header-icons .d-icon to use var(--secondary-low) in dark mode and var(--secondary) in light mode.
Changing the secondary color code in admin/customize/colors/ (this will affect all elements using --secondary color).
Using the prefers-color-scheme media query to change the color based on the OS theme setting.
Creating custom color definitions.
agf1997 finds the second solution promising but notes that it doesn’t work when the dark mode theme is chosen as the “Regular” theme. Don suggests creating a custom color definition using a theme component and provides an example.
agf1997 confirms that the custom color definition solution works. Additionally, they ask if including color_definitions.scss in their theme would work instead of using a theme component, and Don confirms that it would.
I’m trying to figure out out to set a color of an element based on the color scheme selected. The following works well for my light mode, but not so well in my dark mode.
This appears to be exactly what I would like to do (change header icons only, not all items with the --secondary color). One final question … this works if the theme is set as the dark mode theme and dark mode is activated by the OS, but not if the dark mode theme is choosen as the “Regular” theme. Any suggestions there?