You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where select.css includes css related to a <select> element. Some of this CSS is relatively complex and cannot be achieved with tailwind helpers, whereas other bits can such as @apply border and the like. See below.
The issue I'm running into is that there seem to be some specificity issues related to the layer of these CSS files, where the Tailwind forms plugin actually gets applied after my select.css file, causing most of the @apply'd rules to get overwritten by the reset. The issue goes away if I simply apply the helper classes within the component itself,
Am I using the plugin in a way that it wasn't meant to be designed? I could also likely add some classes to my component to overrule the specificity of the reset. Any feedback/opinions appreciated! Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
We are using Tailwind along with the Tailwind forms plugin to reset the styles on form elements in our Create React App application.
Inside our base
.css
file which is in injected into the head of the react app, we have something that looks like the following:Where select.css includes css related to a
<select>
element. Some of this CSS is relatively complex and cannot be achieved with tailwind helpers, whereas other bits can such as@apply border
and the like. See below.The issue I'm running into is that there seem to be some specificity issues related to the layer of these CSS files, where the Tailwind forms plugin actually gets applied after my
select.css
file, causing most of the@apply
'd rules to get overwritten by the reset. The issue goes away if I simply apply the helper classes within the component itself,Am I using the plugin in a way that it wasn't meant to be designed? I could also likely add some classes to my component to overrule the specificity of the reset. Any feedback/opinions appreciated! Thanks!
Beta Was this translation helpful? Give feedback.
All reactions