Stacks icon indicating copy to clipboard operation
Stacks copied to clipboard

Add negative margin conditionals

Open yellis opened this issue 4 years ago • 4 comments

I am trying to use md:mtn6 on an element, and it is not having any effect. I had md:ml6 attached to the same element, and this worked, so I assume that it is a specific issue with conditional classes not being hooked up properly to some or all of the negative margin classes.

yellis avatar May 20 '21 07:05 yellis

Sadly, we don't have any negative margin conditional classes yet. We always err on the side of Stacks having a super lean bundle size. Is there another approach you can take to negative margins? Are you trying to get around padding in a container? Are you fighting against gs[x] classes?

aaronshekey avatar May 20 '21 15:05 aaronshekey

I was eventually able to find another approach here.

I appreciate having a super-lean bundle size. However, the current state of things means that it is a lottery if a given class is supported by conditionals. I ran into another one today that wasn't supported (md:bs-none). So while I appreciate the reasons for not applying conditionals to everything, this makes things like conditionals more expensive to use (when it comes to amount of time to implement).

So if things aren't all going to be supported by conditionals, can this be documented more than it currently is (where the only mention is that "many utility classes in Stacks are also available in screen-size specific variations" - and not all). Even if you list on the conditional classes page what is either included or excluded, it would be a big help (even better would be to have a notation on each utility class man page to indicate conditional support).

yellis avatar May 23 '21 08:05 yellis

A global list would be great!

Even better would be to have a notation on each utility class man page to indicate conditional support

We've got these sprinkled throughout:

image image

Is this what you're looking for?

Someday we'll be able to do something like purgecss, allowing us to have a huge bundle. We'll pare it down to just the classes we actually use on-demand. It'll be sick!

aaronshekey avatar May 23 '21 15:05 aaronshekey

Yes, that is what I was looking for. My bad. I guess I was keyed-in on the term "conditional", and didnt stop to consider "responsive" as a synonym for this in a different context.

yellis avatar May 24 '21 09:05 yellis