-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Styles are getting injected in the classname #492
Comments
It looks like this is caused by the label regex. I think we can fix this by only supporting semicolons instead of semicolons and newlines to end label property declarations, especially since we're going to require semicolons in css declarations going forward anyway. The label property is generally inserted by If you could submit a PR to change the regex on this line to this and add tests that would be great! emotion/packages/emotion/src/index.js Line 150 in 47ec911
/label:\s*([^\s;\n]+)\s*;/g |
I think that new pattern doesn't cut it either. The output of styles is the following: console.log packages/emotion/src/index.js:313
styles & + label::after{color:pink;background:orange;content:'';}
console.log packages/emotion/src/index.js:313
styles after replace & + background:orange;content:'';} And the snapshot therefore looks like this: exports[`input and label selectors input + label styled 1`] = `
<div>
<input
className="css-1vn7mrm-:after{color:pink css-1h8gnp00"
/>
<label>
Label
</label>
</div>
`; Things kinda get better after adding a closing curly bracket as such |
Could you try this? I added an opening brace to the negated character set. Sorry about the lack of documentation around the label property, basically it adds a readable name to the class name, it's generally not manually written but instead added with the /label:\s*([^\s;\n{]+)\s*;/g |
emotion
version: 8.0.12react
version: 16.2.0Relevant code.
What you did:
Tried to style a radio button.
What happened:
The style gets injected into the class name. Worked well with 8.0.2 or something. It outputs kinda like this:
Reproduction:
CodeSandbox reproduction
Problem description:
After updating to the latest version that selectors combination doesn't seem to work anymore.
The text was updated successfully, but these errors were encountered: