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

eliminate useless dynamic classes, store reference to folded componentStyle #3236

Merged
merged 9 commits into from
Aug 27, 2020

Conversation

quantizor
Copy link
Contributor

@quantizor quantizor commented Aug 27, 2020

Fixes #3206

  1. this effectively deduplicates a lot of redundant CSS that is generated
    starting with v4

  2. & self-references are now correctly resolved to the folded layer they
    correspond to

@quantizor
Copy link
Contributor Author

quantizor commented Aug 27, 2020

Published as styled-components@5.2.0-test.2 for testing (or styled-components@test)

@quantizor
Copy link
Contributor Author

This doesn't quite fix #3206 yet, just realized the selectors for composed self-references need to be based on the OG static class name...

@@ -0,0 +1,8 @@
{
"recommendations": [
"christian-kohler.path-intellisense",
Copy link
Member

@kitten kitten Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidental change?

Copy link
Contributor Author

@quantizor quantizor Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, just decided to add it in while I was doing other stuff 😅

kitten
kitten previously approved these changes Aug 27, 2020
…tStyle

1. this effectively deduplicates a lot of redundant CSS that is generated
   starting with v4

2. & self-references are now correctly resolved to the folded layer they
   corespond to
The engines >= 8 thing hasn't been released yet, so this is not
considered a breaking change.
@Zenser
Copy link

Zenser commented Dec 7, 2022

@probablyup hi, i see this #2071 use for style isolate.

// Comp -> .sc-a
// color: red -> .a
// color: blue -> .b

.sc-a {}
.a { color: red }
.a + .sc-a { margin-left: 10px }
.b { color: blue }
.b + .sc-a { margin-left: 10px }

It is useful for me, and now how do style isolate?

Has many styled-components instants in one container at my case. Thanks for your callback.

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

Successfully merging this pull request may close these issues.

Complex selectors with ampersands break after the component is extended.
3 participants