-
Notifications
You must be signed in to change notification settings - Fork 38
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
Use data attribute to choose component colors #2507
Comments
This needs to be done after #2287 |
@mimarz & @Febakke Here's my step-by-step plan to implement this, based on my existing proof of concept. If this seems okay, should I add these as separate issues and add them to the board, or is it enough to track it here?
|
After demo today we suggest the following.
|
color
great againdata-color
to choose component colors
data-color
to choose component colors
Figma testing with @unekinn Color scales that will be included as Figma variables Two new modes
Obs Figma tasks
|
Oppsumering av diskusjonen tidligere idag rundt Brukere kan fritt navngi fargen og første fargen blir satt som default farge for Edit: Oppdatert |
Fixes with #2836 |
We have finished this feature, further tweaks and adjustments will be done in separate issues |
TLDR; Lift semantic color definition to a higher level and have components only use a generic
--ds-color-*
variable. Which semantic color i used for a component is then defined by the user using data-attributes ([data-color="accent|neutral|my-color"]
). Users are free to add any number of colors and name them accordingly to their semantic needs.Example code
WIP Notes
data-ds-color-scheme
) to change which color scale the color variables are pointing to.--ds-color-accent-*
which works like this, but might be hard to rename to--ds-color-*
because of mapping to Figma variables.data-ds-color-mode
, which users can use to switch betweendark | light | auto
Tasks
The text was updated successfully, but these errors were encountered: