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

Bug CSS in JS with !important rule #6352

Closed
rioaguspermana opened this issue Feb 19, 2019 · 3 comments
Closed

Bug CSS in JS with !important rule #6352

rioaguspermana opened this issue Feb 19, 2019 · 3 comments
Labels
Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).

Comments

@rioaguspermana
Copy link

Bug report

Describe the bug

can't get CSS in JS with !important working

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a div with some style
    <div style={{ margin: "200px", textAlign: "center", width: "100px", height: "100px", border: "1px solid black", background: "red !important" }} > some text </div>
  2. result
    image
  3. when i'm inspect element, style rule for background is gone.
    image
  4. if i remove the !important it works

Expected behavior

style rule is working with !important

System information

  • OS: Windows 10
  • Browser : Chrome Version 72.0.3626.109
  • Version of Next.js: 8.0.0
@timneutkens
Copy link
Member

This is an issue in React: facebook/react#1881

@timneutkens timneutkens added the Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.). label Feb 19, 2019
@timneutkens
Copy link
Member

You could use github.com/zeit/styled-jsx for this though.

@rioaguspermana
Copy link
Author

Thanks for the confirmation

@lock lock bot locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).
Projects
None yet
Development

No branches or pull requests

2 participants