question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

image

I haven’t tried to reproduce the error, but we should look into it and see what might be causing it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
jcenturioncommented, Jun 7, 2018

@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.

0reactions
francocorreasosacommented, Jun 8, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found