CSS-in-JS-generator
CSS-in-JS-generator copied to clipboard
hyphen removal in class names
.display2 {
color: 'red';
}
.display-2 {
font-size: 5.5rem;
font-weight: 300;
line-height: 1.1;
}
These seem to generate the same class name in JS:
export const display2 = css`
font-size: 5.5rem;
font-weight: 300;
line-height: 1.1;
`;
export const display2 = css`color: "red";`;
Not sure if there is a good solution.
You are right, classnames are camelized, and so this can lead to something wrong... I don't have the answer right now, but having both display-2 and display2 is an edge case, as library is still experimental.
push the class name to an array and check whether it already exists. If yes, add a suffix that can be a unique id.