Replies: 1 comment 2 replies
-
I'm not really sure what you're suggesting. The example you gave references e.g. const colors = {
success: '#32b643',
}
export default createGlobalTheme(':root', {
colors: {
success: colors.success,
successLight: lighten(colors.success, 0.15),
}
}); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Really like the vanilla-extract here, so happy to get rid of preprocessors like sass or less in favor of typescript:), so first thanks for your work.
One thing that I miss a bit is the possibility to use the lighten or the darken css utilities. I know it's because css variables are not preprocessed but still there is a way to do it with HSL colors.
The end result would be something like that:
vars.css.ts
button.css.ts
The idea would be to convert
#32b643
internally to it's HSL representation and then handle this representation at the vanilla-extract level, ie. when you accesscolors.success
in a.css.ts
file it applies thehsl()
css functional notation to it. When you uselighten
instead of applying thehsl()
functional it would first modify the light for instance.Not sure wether it's a good idea to go this way:)
Any thought on how to use lighten and/or darken utilities in your
.css.ts
styles ?Beta Was this translation helpful? Give feedback.
All reactions