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

Use a custom PostCSS plugin for expanding nested selectors for static styles #264

Closed
emmatown opened this issue Aug 17, 2017 · 3 comments
Closed

Comments

@emmatown
Copy link
Member

Currently we use postcss-nested to expand nested selectors. This causes a problem because it's inconsistent with the way we expand styles without extractStatic.

For example,

const cls = css`
  .some-class {
    background-color: hotpink;
  }
`

will expand to this without extractStatic

.css-hash.some-class {
  background-color: hotpink;
}

but it will expand to this with extractStatic

.css-hash .some-class {
  background-color: hotpink;
}
@ai
Copy link

ai commented Aug 18, 2017

Maybe it could be better to fix postcss-nested or fix how emotion uses postcss-nested

@emmatown
Copy link
Member Author

@ai We don't use postcss-nested to expand selectors at runtime and we expand them differently to the way postcss-nested does. It's not really about fixing postcss-nested because emotion and postcss-nested expand them differently, neither way is necessarily wrong.

@emmatown
Copy link
Member Author

Closing since we use stylis now.

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