mdgriffith/style-elements/3.2.0

NOTE: this package is not compatible with Elm 0.19.1

Style.Scale

When designing it's nice to use a modular scale to set spacial rythms.

scaled =
    Scale.modular 16 1.618

A modular scale starts with a number, and multiplies it by a ratio a number of times.

Then, when setting font sizes you can use:

Font.size (scaled 1) -- results in 16


Font.size (scaled 2) -- 16 * (1.618 ^ 2) results in 25.8

We can also provide negative numbers to scale below 16px.

modular : Float -> Float -> Int -> Float
roundedModular : Float -> Float -> Int -> Float

Same a modular but rounds to the nearest integer.

Still returns a Float for compatibility reasons.