Reset breakpoint-ed values, back to their original values #6118
flatline-studios
started this conversation in
Ideas
Replies: 1 comment
-
This isn't a full solution for you, but for a 'full-bleed' effect, try: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm new to Tailwind, so forgive me if this already exists within this wonderful toolkit, but is there a way to reverse all the previously applied breakpoint styles, so if I need to completely change the way an element, or component, is presented, then it's a simple, one statement affair. Rather than having to painfully undo them all, one by one?
This is probably better explained with a quick example, so, if I have something like:
Then I decide that at the
md
breakpoint, I want thisdiv
to be completely different, so I modify it to look something like:Then in order for me to simply say, I just want the
div
to have a padding of 2, a margin of 2, and be ablock
again, I instead have to also reset the height and width that's carried over from thesm
breakpoint.I don't want to change the default config breakpoints, so that the
sm
breakpoint stops the pixel before themd
kicks in, as I probably have other styles that rely on this cascade.Nor do I want to create a new
sm2md
breakpoint, or anything, as that will just make it messy to deal with, is likely to cause errors, etc.What I really want to be able to do, is say, "Hey! I don't want any of this
sm
stuff to bleed over in to themd
styles.".I would propose something like:
Which would give the equivalent results to the much larger 2nd code example.
This is a contrived example, but I think it illustrates the idea.
I can't see that Tailwind can't handle this, practically, but I can't seem to find any documentation that indicates that this is possible.
I also realise that this won't be possible on inline styles (other than maybe having a straight up
<div class="sm:m-4 md:reset-initial"></div>
, that just hardcore resets every possible style toinitial
, orinherit
); but when pulling out long class blocks with the@apply
directive, I think this makes a lot of sense to exist.Beta Was this translation helpful? Give feedback.
All reactions