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

Mixing style objects and functions messes up specificity resolution #74

Open
dzearing opened this issue Jun 11, 2019 · 1 comment
Open

Comments

@dzearing
Copy link

dzearing commented Jun 11, 2019

Expected:

const Title = styled("h1")(p => ({
  background: "blue"
}));

const Title2 = styled(Title)({
  background: "green"
});

Expected:
Title2 is green

Resulted:
Title2 is blue, because it has 2 class names and one of them loses the specificity war.

Repro:
https://codesandbox.io/s/styled-jss-playground-repro-mo3c8

@kof
Copy link
Member

kof commented Jun 11, 2019

I am working on a new styled API on top of the new react-jss hooks based API, so I need to check if this also happens there cssinjs/jss#1094

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

2 participants