Autodesk / hig

Autodesk's unified design system
https://storybook.weave.autodesk.com
Apache License 2.0
177 stars 114 forks source link

Aliases for spacing basics #1556

Open beauroberts opened 5 years ago

beauroberts commented 5 years ago

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.

nfiniteset commented 5 years ago

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 commented 5 years ago

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

beauroberts commented 5 years ago

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.