Disabling textOpacity/backgroundOpacity should remove the variables similar to tailwind's output
See original GitHub issueIn Tailwind, disabling the text and background opacity would remove the variables but this is not the case for twin.macro.
// tailwind.css (original)
.bg-red-400 {
--bg-opacity: 1;
background-color: #fc8181;
background-color: rgba(252, 129, 129, var(--bg-opacity));
}
// tailwind.config.js
corePlugins: {
textOpacity: false,
backgroundOpacity: false,
},
// tailwind.css (with above settings)
.bg-red-400 {
background-color: #fc8181;
}
// twin.macro
console.log(tw`bg-red-400`) // { --bg-opacity: "1", backgroundColor: "rgba(252, 129, 129, var(--bg-opacity))"}
this is adding some unnecessary overhead, in my case i’m using twin.macro to animate object properties so I would prefer to only manipulate the background or color properties(as it should).
_Originally posted by @cybervaldez in https://github.com/ben-rogerson/twin.macro/issues/86#issuecomment-707237243_
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Optimizing for Production - Tailwind CSS
Tailwind CSS is incredibly performance focused and aims to produce the smallest CSS file possible by only generating the CSS you are actually...
Read more >[JIT] Disabling opacity core plugins doesn't change output of ...
I am able to use Tailwind 2 with the opacity utils disabled (and avoiding a few other utils that use CSS variables), but...
Read more >How to remove unnecessary css when it compiled to output in ...
Just disable Preflight // tailwind.config.js module.exports = { .... corePlugins: { preflight: false, } }.
Read more >Why I Don't Like Tailwind CSS | Aleksandr Hovhannisyan
According to this paradigm, your class names should be as granular as possible, responsible for one main task. These utility classes serve as ......
Read more >Disabling the Tailwind input ring - Roman Sorin
If you've ever worked with Tailwind, you've probably come across an input ring – but it isn't always clear on how to remove...
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
The feature is now in v1.12.0 🎉
@cybervaldez @r0skar Could you please check my PR and see if this covers your use-cases?