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

Fix styled inheritance #40

Merged
merged 5 commits into from
Apr 30, 2024
Merged

Fix styled inheritance #40

merged 5 commits into from
Apr 30, 2024

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Apr 30, 2024

Issue

A Pigment styled component (child) is replaced by as value provided to the parent:

const Child = styled('span')({ classes: ['child'] });

const Parent = styled(Child)({ classes: ['parent'] });

<Parent as="div" />; // <div class="parent" />

This behavior is different from Emotion & Styled-components where styles of child are propagated even as is provided to the parent.

Expected

const Child = styled('span')({ classes: ['child'] });

const Parent = styled(Child)({ classes: ['parent'] });

<Parent as="div" />; // <div class="child parent" />

@siriwatknp siriwatknp added the bug 🐛 Something doesn't work label Apr 30, 2024
Copy link
Contributor

@brijeshb42 brijeshb42 left a comment

Choose a reason for hiding this comment

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

Thanks

@siriwatknp siriwatknp merged commit db4bfb4 into master Apr 30, 2024
17 checks passed
@siriwatknp siriwatknp deleted the fix/styled-inherit branch April 30, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants