quasar icon indicating copy to clipboard operation
quasar copied to clipboard

[Request] on-left and on-right and their new cousins pad-*

Open spectrolite opened this issue 9 years ago • 2 comments

I’ve been on the fence for weeks about a semantic issue I have with on-left and on-right, as I feel they are named backwards. They are way more useful than just in their original intent's context (on-right = this thing is to the right of a main element, so I need special padding on this thing's left side). When used out of context, and I’m sure many of us do it, the naming is just weird: on-left adds right padding… ok ....

But changing this now will break everybody’s fine-tuning…

So maybe @rstoenescu could be so kind as to add another couple of helpers, called e.g. pad-leftand pad-right that would have the same effect as on-left on-right, except each would act on it own side of the element : pad-right adds whitespace on the right.

on-left and on-right can now go back to their original business of dealing with side-elements, and from now on we would have a semantically valid (=easily understandable) couple of helper classes for all the cases where we want to fine tune the spacing of elements.

Following this logic, another couple of classes to form a top/bottom/left/right quatuor would allow us to have some control over the vertical spacing too, and would definitely be welcome.

spectrolite avatar Jul 28 '17 11:07 spectrolite

I don’t know if this is in the realm possible or of science-fiction, or even if it’s really a good idea, but having the pad-* classes apply a padding that was proportional to parent’s size (a bit like q-layout does), would really be useful. What I mean by that, is for example when you use it inside of a button that is either small or big or normal, you get different padding. And if you use it in a container div, it scales with each media breakpoint.

While I stand by my original point about the usefulness of a pad-* quatuor, I’m really not so sure about having a variable width. Please speak your mind.

Another thought I had about those classes is that maybe it would be useful to have say 3 steps (like S/M/L) or maybe 5 (xs/sm/md/lg/xl but that may be confusing) or just 4, on an exponential scale:

e.g. If base (eg. pad-top) is 8px

  • pad-top-nano = 4px
  • pad-top-0 = 4 px
  • pad-top-1 = 8px
  • pad-top-2 = 16px
  • pad-top-3 = 32px
  • pad-top-4 = 64px

The scale could also be made to match quasar’s typographic scale (h5->h1). Maybe that would be even more useful and visually harmonious by default.

Finally, a nice way to round up this family would be to add

  • pad-v pads vertically, ie. top + bottom
  • pad-h pads horizontally, ie. left + right
  • pad-all

spectrolite avatar Jul 28 '17 12:07 spectrolite

Added in future v0.15. Examples: q-ml-small, q-pr-regular Syntax: q-[m | p][l | r | t | b | a]-[small | ....] -- m (margin), p (padding), l (left), r (right), ......

rstoenescu avatar Oct 26 '17 18:10 rstoenescu