Created
September 21, 2024 19:36
-
-
Save ManUtopiK/23b90e86d8b1285cf5b178d2d65d1eac to your computer and use it in GitHub Desktop.
unocss make variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const shades = [ | |
50, | |
...Array.from({ length: 9 }).map((_, i) => (i + 1) * 100), | |
950, | |
]; | |
export const makeVariable = ({ fallbackValue, name, shade, withVar }) => { | |
const variable = `--${name}-${shade}`; | |
const value = fallbackValue ? variable + ", " + fallbackValue : variable; | |
return withVar ? `var(${value})` : variable; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment