oddbird / accoutrement-scale

Size and scale helpers for typography and layout
MIT License
9 stars 1 forks source link

Multiple values support #9

Closed mg901 closed 7 years ago

mg901 commented 7 years ago

Hi, Miriam!) I continue to explore your wonderful toolkit, and I had another question. Can accoutrement-scale support multiple values?

as here

mirisuzanne commented 7 years ago

Yes, but different.

Accoutrement allows you to create any number of ratios (we provide the basics), and use them in any combination to adjust any starting values. But instead of interlacing the base/ratio results in a single "scale" - we allow you to manipulate and combine each individually and explicitly.

// define any ratios that you want (in addition to the musical scale)...
$ratios: (
  'my-ratio': 1.375,
  'another-ratio': 1.42,
);

// use them alone or in comination to manipulate any base numbers
$sizes: (
  'rhythm': 16px ('my-ratio': 3, 'another-ratio': 1),
  'small-text': 24px ('my-ratio': -2),
);

(These are all arbitrary numbers. I'm just demonstrating how you can use it, not suggesting these calculations will turn out well)