Feature request: use `!important` with theme value
See original GitHub issueI’d like to be able to do something like following:
<div sx={{ ml: important(4) }}>
that is, using theme value (eg. from space
scale), but with !important
appended to it in resulting CSS.
Is there currently any way to achieve this? I thought only of this:
const Component = () => {
const { theme } = useThemeUI()
return (
<div sx={{ ml: `${theme.space[4]}px !imporant` }}
)
}
Any ideas?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Prioritising the right feature set using theme based ...
To identify themes, use the following: Look at the product backlog and see if if there are certain trends which can be used...
Read more >Feature request: general background theme, more options?
The 'theme' itself is a lot more than just the background: when ... You can edit the colors and pick something else using...
Read more >Feature Requests: How to Collect Them and Engage Users ...
Feature requests are an important window into your customers desires and priorities. Here's how to make the most of them, and handle the ......
Read more >How To Prioritize Feature Requests: 5 Tips for Success
Here's some ideas on how to prioritize feature requests for your SaaS ... your SaaS product features according to the value they bring....
Read more >[Case Study] Building a Better "Feature Request" System ...
By now, you'll have spotted that it's important to respond to all feature requests in a positive way. This doesn't mean that you...
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
I think that CSS-in-JS solves the problem of specificity, and you can achieve everything you need without
!important
. I’d discourage usingimportant
, and I doubt we’ll introduce any “first-class support” for it.There aren’t any helpers like what you’ve described currently, but you can also use functional values like so:
ml: t => `${t.space[4]}px !important`
– with that in mind, I think you might be able to create a utility that does this in a more ergonomic way