- Issue created by @balintbrews
- 🇺🇸United States luke.leber Pennsylvania
This sort of thing provides unique challenges (note how it's possible to produce contrast-inaccessible variants).
Originally, we sort of "flattened" the options, but found it wasn't flexible enough for our designer. More recently we've taken the approach in our in-house design system to make colors automatically contrast themselves based on their parent contexts. In general, components have light and dark variations set up and the CSS makes sure things stay accessible.
If curious, see https://psu-ooe.github.io/?p=atoms-cta-auto-contrast-deeply-nested (examples) and https://github.com/PSU-OOE/components/blob/main/packages/button-base/src... (driving CSS).
I also did a write-up at https://www.lukeleber.com/blog/2024-07-25-context-aware-components
It's a lot more complex on the CSS end, but even if JavaScript starts hacking and slashing the DOM after the page is built we usually never have to worry about color contrasting.
Food for thought 🙂.
- 🇳🇱Netherlands balintbrews Amsterdam, NL
That looks very neat, thanks for sharing! 😍
I don't think we want to go this far in Experience Builder. I kind of just needed a quick solution for demos where the logo is in nice resolution, and thought it would come handy for others. The kind of solution you are suggesting should live in design systems.
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
This is fantastic!
If for some reason Lauri doesn't want it in XB, happy to have this in SDDS :)
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
Note that xb-demo has code to hide XB components since those are for testing so we'll need to make sure Adam updates that accordingly if this is in XB.
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
Just tested from within SDDS and it works beautifully:
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
We need this for next week so I'd like to copy this to SDDS for now.
- 🇳🇱Netherlands balintbrews Amsterdam, NL
According to @lauriii, we'll remove all components from XB, so we're not adding this in there either. Opened ✨ Add Drupal logo component Active in the SDDS queue.
- 🇺🇸United States Kristen Pol Santa Cruz, CA, USA
The component has been added to SDDS! Thanks :)
✨ Add Drupal logo component Active
A new release will probably be created in the next couple of days.