Using a styled() override breaks CSS styles
See original GitHub issue(Reported by @jcenturion)
When adding the following lines from the client list example:
const ClientID = styled(StyledTextSubdued)`
margin-right: ${spacing.xsmall};
line-height: normal;
`
… it causes styles to disappear:
I haven’t tried to reproduce the error, but we should look into it and see what might be causing it.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
How to Override CSS Styles - W3docs
Example of overriding CSS style with the Class selector: Let's now see how we can make one class override another. If that class...
Read more >Overriding · Issue #8 · styled-components/styled ... - GitHub
styled -components injects a class with the given styling. ... The second way to override the style of the components is to use...
Read more >FAQs - styled-components
The way to override styles with a high specificity is to simply increase the specificity of your own styles. This could be done...
Read more >Changing from div with style (working correctly) to styled ...
Changing from div with style (working correctly) to styled component causes user agent stylesheet to overwrite display.
Read more >Override Inline Styles with CSS
How to Override Inline Styles with Style Sheet ... attr sections [style]. I'm not sure why you would even use it because it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@landitus , @francocorreasosa , @nkohari I’ve created a repository with the code which reproduce the issue: https://github.com/jcenturion/cosmos-bug.
Let me know if you don’t get the invitation.
NOTE: Once you finish using the repo let me know so I can delete it.
I’m wondering if
styled-components
has like an internal context that is being used from cosmos. And when you create a styled component in your own project, there’s a internal conflict between the two contexts and it breaks.