Skip to content
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

CSS variables in color data attributes work! #18

Open
0str1ch opened this issue Jul 4, 2018 · 0 comments
Open

CSS variables in color data attributes work! #18

0str1ch opened this issue Jul 4, 2018 · 0 comments

Comments

@0str1ch
Copy link

0str1ch commented Jul 4, 2018

Using standard CSS variables var(--your-varible-name) in the primary and secondary data attributes works.

Might be helpful to include this tip in the documentation as it makes swapping colors globally for icons in a non-destructive manner possible, without editing the Vivid Icon source in node_modules/vivid-icon/src/config.js and then rebuilding from source every time a change is made.

Example for those unfamiliar with CSS variables:
<i data-vi="flame" data-vi-size="90" data-vi-primary="var(--primary)" data-vi-accent="var(--secondary)" data-vi-prop="var(--tertiary)"></i>

Then, set up your variables:
:root { --primary: #010101; --secondary: #333; --tertiary: #dbdbdb; }

And that's it! Hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant