Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hyphen removal in class names #5

Open
jimthedev opened this issue Oct 8, 2017 · 2 comments
Open

hyphen removal in class names #5

jimthedev opened this issue Oct 8, 2017 · 2 comments

Comments

@jimthedev
Copy link

.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.

@brikou
Copy link
Owner

brikou commented Oct 10, 2017

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.

@ritz078
Copy link

ritz078 commented Dec 8, 2017

push the class name to an array and check whether it already exists. If yes, add a suffix that can be a unique id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants