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

Support for pseudoelements, pseudoselectors and nesting #61

Open
idmadj opened this issue Jun 23, 2021 · 1 comment
Open

Support for pseudoelements, pseudoselectors and nesting #61

idmadj opened this issue Jun 23, 2021 · 1 comment
Labels
question Further information is requested

Comments

@idmadj
Copy link

idmadj commented Jun 23, 2021

It seems like pseudoelements/pseudoselectors/nesting are not supported, ie. styles are not inlined for nested rules.
https://styled-components.com/docs/basics#pseudoelements-pseudoselectors-and-nesting

For instance, this:

const MyElement = styled.div`
  color: blue;

  & p {
    color: red;
  }
`;

...

return (
  <MyElement>
    <p>Some text</p>
  </MyElement>
);

... will output:

<div style="color: blue;"><p>Some text</p></div>

Is this possible to implement?

@sbekrin
Copy link
Owner

sbekrin commented Jul 2, 2021

hey @idmadj, good suggestion! i'm considering adding :hover/:before/:after/etc. support which needs mixed inline and classic styles; as for nested rules it's tricky and probably won't be supported for the time being

@sbekrin sbekrin added the question Further information is requested label Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants