hig icon indicating copy to clipboard operation
hig copied to clipboard

Aliases for spacing basics

Open beauroberts opened this issue 6 years ago • 3 comments

Hello - an dev ergonomics request! Would it be possible to add more terse aliases for spacing/sizing values, e.g. extraExtraSmall => xxSmall. We were thinking of adding this in our layer but thought we'd ask if other devs would also prefer something that requires a bit less typing.

beauroberts avatar Jan 21 '19 16:01 beauroberts

I like it. I'm going to prioritize deprecation warnings before this story.

  "avatar.extraSmall": {},
  "avatar.extraLarge": {},
  "spacings.extraExtraSmall": {},
  "spacings.extraSmall": {},
  "spacings.small": {},
  "spacings.medium": {},
  "spacings.large": {},
  "spacings.extraLarge": {},
  "spacings.extraExtraLarge": {},

becomes...

  "avatar.xSmall": {},
  "avatar.xLarge": {},
  "spacings.xxSmall": {},
  "spacings.xSmall": {},
  "spacings.small": {},
  "spacings.medium": {},
  "spacings.large": {},
  "spacings.xLarge": {},
  "spacings.xxLarge": {},

nfiniteset avatar Jan 22 '19 22:01 nfiniteset

Do you support aliasing as distinct from referencing in your design language?

nfiniteset avatar Jan 22 '19 22:01 nfiniteset

If we were to do it ourselves we'd just do something like:

'spacings.xSmall': {
  value: {
    ref: 'spacings.extraExtraSmall',
  },
},

I suppose there's a chance that they could become out of sync if someone chose to override the value of xSmall but not extraExtraSmall, but for us at least I don't really see that happening in practice.

beauroberts avatar Jan 23 '19 11:01 beauroberts