1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-04 15:48:01 +00:00

Add CSS !important Is Not Supported By Inline Styles as a react til

This commit is contained in:
jbranchaud
2018-10-03 13:39:14 -05:00
parent 5e351d6b05
commit 5021590d5a
2 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
# CSS !important Is Not Supported By Inline Styles
You can get pretty far with React's inline styling of components. There are
however a few limitations. One such limitation is that the `!important`
clause is not supported.
If you try applying `!important` to an inline style like so:
```jsx
<div style={{ color: "red !important" }}>
My div
</div>
```
You'll be disappointed when you open up the browser and inspect that `div`
tag. The `color` rule will be ignored and excluded from the output html.
[source](https://github.com/facebook/react/issues/1881)