Linear gradient with optionvalue from theme colors #699
Answered
by
dannytce
yudyananda
asked this question in
Help
-
Hi, is it possible to get the option from the theme color for the properties like background image? in my case i create my own css properties via utils. const { getCssString, styled } = createCss({
theme: {
colors: {
indigo100: 'hsl(192, 58%, 88%)',
...
}
},
utils: {
gradient: config => value => ({
backgroundImage: `linear-gradient(${value})`,
})
}
})
const Box = styled('div', {
linearGradient: `19deg, /*value from theme colors*/ 0%, /*value from theme colors*/ 100%`,
}); |
Beta Was this translation helpful? Give feedback.
Answered by
dannytce
Aug 3, 2021
Replies: 1 comment 1 reply
-
Hello :) I believe you can use any theme token, the only thing you need to do is to use scale prefixing const Box = styled('div', {
gradient: `19deg, $colors$indigo100 0%, $colors$indigo100 100%`,
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
yudyananda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello :) I believe you can use any theme token, the only thing you need to do is to use scale prefixing