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
Another one of my CSS-order-related feature proposals, heh.
I would like to be able to control where the utilities added by some of my plugins end up in the generated CSS in a very general way. Basically would like to be able to choose between BEFORE or AFTER the core plugins' utilities. Right now they're always added AFTER them.
An example of where this would be useful is my tailwindcss-gap plugin. It generates gap-* utilities that set the margin and/or padding properties, and I want it to be possible to override them with the core m-* or p-* utilities. Right now I achieve that by making the gap-* classes components instead of utilities, but that's a hack. Also, things such as the important option don't get applied to components but they should apply to gap-* classes.
addUtilities() already accepts an options object as its second argument, so I imagine a position option that accepts a string ('after' or 'before').
This discussion was converted from issue #1069 on August 25, 2020 10:10.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
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
-
Another one of my CSS-order-related feature proposals, heh.
I would like to be able to control where the utilities added by some of my plugins end up in the generated CSS in a very general way. Basically would like to be able to choose between BEFORE or AFTER the core plugins' utilities. Right now they're always added AFTER them.
An example of where this would be useful is my
tailwindcss-gap
plugin. It generatesgap-*
utilities that set themargin
and/orpadding
properties, and I want it to be possible to override them with the corem-*
orp-*
utilities. Right now I achieve that by making thegap-*
classes components instead of utilities, but that's a hack. Also, things such as theimportant
option don't get applied to components but they should apply togap-*
classes.addUtilities()
already accepts an options object as its second argument, so I imagine aposition
option that accepts a string ('after'
or'before'
).Beta Was this translation helpful? Give feedback.
All reactions