Stack utilities
#12513
Replies: 1 comment
-
Even putting the /* from */
.space-y-16 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(4rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(4rem * var(--tw-space-y-reverse));
}
/* to */
.space-y-16 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y: 4rem;
--tw-space-y-reverse: 0;
margin-top: calc(var(--tw-space-y) * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(var(--tw-space-y) * var(--tw-space-y-reverse));
} |
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.
-
In my Statamic (CMS) Starter Kit called Peak, I use a page builder approach where all blocks within the page builder get space between them by putting them in a one column grid with gaps. This quickly becomes limiting when you want certain blocks to have no spacing above or below them.
I expanded upon the
space-y
utilities and thought that this could be nice idea to add to Tailwind core.The utilities I added are the following:
This way you can do this in your HTML:
Which would compile to:
You can also use arbitrary values and modifiers like
stack-[5px] md:stack-16
This is the relevant PR to my public kit.
Curious if this something you like.
Best,
Rob
Beta Was this translation helpful? Give feedback.
All reactions