-
-
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
Object syntax - Lenient property formatting. #2270
Comments
The object styles are serialized to a string so in a case like As to |
I think that it could be great to eventually remove the patch for
.id {
color: hotpink;
:hover {
color: red;
}
}
.id {
color: hotpink;
}
.id :hover {
color: red;
}
.id {
color: hotpink;
}
.id :hover {
color: red;
}
.id {
color: hotpink;
}
.id:hover {
color: red;
} As a side note, the spec for https://www.w3.org/TR/css-nesting-1/ seems to require either |
@oliviertassinari yeah, I plan to remove this code in the next major version. It was only introduced to ease the transition from Emotion 10 to Emotion 11. For the time being, we probably gonna stick to LESS/SASS semantics. They are still vastly popular and this is what people got used to. This doesn't conflict with the CSS nesting proposal - it's just an additional syntax that would be allowed. If you find this |
Description:
Version: 11.1.5
I've discovered that when using object syntax, you can be more relaxed when specifying child elements or pseudo elements than the documentation seems to let on.
The doc's examples do this:
But I've found the following also work:
Is this behavior intentional? Should one avoid using the additional formats I showed?
BTW, when using IDE autocompletion it suggests
":hover"
without the ampersand.Documentation links:
https://emotion.sh/docs/object-styles
The text was updated successfully, but these errors were encountered: