Socket
Book a DemoInstallSign in
Socket

new-typography-scale

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-typography-scale

Size and scale helpers for typography and layout.

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

new-typography-scale

Sass size & scale management tools. Based on Accoutrement-scale. Removed superfluous functions and mixins (baseline and font-size). part of Accoutrement suite. Gather all your sizes into a single map, generate new sizes based on modular scales or arbitrary functions, and access them by name.

Quick Start

npm install new-typography-scale

Import the library:

@import 'path/to/new-typography-scale/sass/scale'

Establish your palette of ratios and sizes:

$ratios: (
  'my-ratio': 1.25,
);

$sizes: (
  'root': 24px,
  'rhythm': 'root' ('fifth': 1, 'convert-units': 'rem'),

  'h1': 'root' ('my-ratio': 3),
  'h2': 'root' ('my-ratio': 2),
  'h3': 'root' ('my-ratio': 1),

  'page': 8in,
);

Results will be returned in the units they were defined, but can be converted in the map settings (as above), or on-the-fly using size:

.example {
  // size('page') would return `8in`...
  width: size('page', 'px');
}

Access your sizes from anywhere, with helpers for setting font-sizes and line-heights:

h1 {
  max-width: size('page');
}

We can only calculate integer steps along an exponential scale, but if you want more power, install MathSass, and we'll let them do the hard math.

$sizes: (
  'complex': 'root' ('my-scale': 1.25),
);

Keywords

sass

FAQs

Package last updated on 04 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.