styless
styless copied to clipboard
Guards Not Working With Strings
& when (@variant = "secondary") {
background-color: @btnSecondaryBgColor;
border-color: @btnSecondaryBorderColor;
color: @btnSecondaryColor;
}
This guard is always entered, even when props.variant is not equal to secondary.
Thanks for reporting this issue, I believe we have limited support for guards. Could you add the complete example with the React component and I will try it.
Thanks,
A workaround is to use the styled syntax
${props => props.variant === "secondary" && css`
background-color: @btnSecondaryBgColor;
border-color: @btnSecondaryBorderColor;
color: @btnSecondaryColor;
`}