Adding an '_active' Attribute to Button Recipes #2431
Answered
by
astahmer
yoon-jisung
asked this question in
Q&A
-
"I'm getting this error, but I'm not sure what I'm doing wrong. Can you help me?"const buttonRecipe = cva({
base: {
border: '0',
cursor: 'pointer',
display: 'inline-block',
lineHeight: '1',
fontStyle: 'normal',
fontWeight: '400',
},
variants: {
colorType: {
none: {
color: 'token(colors.coldBlack900)',
backgroundColor: 'token(colors.coldBlackG100)',
},
whiteRound: {
border: '1px solid token(grayscale.coldBlack300)',
background: '#ffffff',
},
primary: {
color: 'white',
backgroundColor: {
base: 'token(colors.coldBlue300)',
_hover: 'token(colors.coldBlue400)',
_active: 'coldBlue500',
},
}, |
Beta Was this translation helpful? Give feedback.
Answered by
astahmer
Mar 25, 2024
Replies: 1 comment
-
it looks like an escaping issue happening because of the can you try without using const buttonRecipe = cva({
base: {
border: '0',
cursor: 'pointer',
display: 'inline-block',
lineHeight: '1',
fontStyle: 'normal',
fontWeight: '400',
},
variants: {
colorType: {
none: {
color: 'coldBlack900',
backgroundColor: 'coldBlackG100',
},
whiteRound: {
border: '1px solid token(grayscale.coldBlack300)',
background: '#ffffff',
},
primary: {
color: 'white',
backgroundColor: {
base: 'coldBlue300',
_hover: 'coldBlue400',
_active: 'coldBlue500',
},
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
yoon-jisung
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it looks like an escaping issue happening because of the
.
, which leads to invalid CSS syntaxthis might happen if some tokens are not found (and therefore won't be replaced at build-time to their CSS variable equivalent)
can you try without using
token(
when not necessary (e.g composite values likeborder
), ex: