Vertical Rhythm and Modular Scale: Typesettings

23
Vertical Rhythm & Modular Scale Creating a UI That Is Based on Typographic Rules Using Sass and Math

description

Vertical Rhythm & Modular Scale: Creating a UI That Is Based on Typographic Rules Using Sass and Math

Transcript of Vertical Rhythm and Modular Scale: Typesettings

Page 1: Vertical Rhythm and Modular Scale: Typesettings

Vertical Rhythm & Modular ScaleCreating a UI That Is Based on Typographic Rules Using Sass and Math

Page 2: Vertical Rhythm and Modular Scale: Typesettings

Ian Rose@rose_ianDesigner at NBC News Digital

Follow along during the demo:http://codepen.io/ianrose/professor/diKpn/

Page 3: Vertical Rhythm and Modular Scale: Typesettings

“ Space in typography is like time in music. It is infinitely divisible, but a few proportional intervals can be much more useful than a limitless choice of arbitrary quantities.”Robert Bringhurst, The Elements of Typographic Style

Page 4: Vertical Rhythm and Modular Scale: Typesettings

Vertical Rhythm is the relationship of the height & spacing of vertically stacked elements.

Page 5: Vertical Rhythm and Modular Scale: Typesettings
Page 6: Vertical Rhythm and Modular Scale: Typesettings

Modular Scale is just a sequence of numbers related to each other by a common ratio.

Page 7: Vertical Rhythm and Modular Scale: Typesettings
Page 8: Vertical Rhythm and Modular Scale: Typesettings

Benefits of Using Typographic Systems

Page 9: Vertical Rhythm and Modular Scale: Typesettings

1. Consistency and Patterns For The Users2. Creates a System of Constraints for the DesignerLet math do the boring repetitive stuff and free time & energy for the real design challenges.

Page 10: Vertical Rhythm and Modular Scale: Typesettings
Page 11: Vertical Rhythm and Modular Scale: Typesettings

Making Vertical Rhythm Easier to Implement & Master» Think of the web as the web and not

approach it the exact same way as print design.

Page 12: Vertical Rhythm and Modular Scale: Typesettings

The Baseline» Use a small vertical unit to create the

rhythm

» Typically just line-height is too large a value

» All UI elements can benefit from following rhythm & modular scale

» Don't stress about where on the baseline

Page 13: Vertical Rhythm and Modular Scale: Typesettings
Page 14: Vertical Rhythm and Modular Scale: Typesettings

Browser Rounding» Accept browsers

don't round numbers the same way

» A user is not comparing your site in Chrome vs Firefox

» Consistency within an session/experience is the important part

Page 15: Vertical Rhythm and Modular Scale: Typesettings

The Math & Properties Are Already Figured Out» line height

» margin top & bottom

» padding top & bottom

» border top & bottom

» horizontal rule

» front size

Page 16: Vertical Rhythm and Modular Scale: Typesettings

Sass Tools That Already Exist» Compass

» Bourbon

» Typeplate

» Typecsset

» Sassaparilla

Page 17: Vertical Rhythm and Modular Scale: Typesettings

TypesettingsYet Another Sass Type Toolkit (YAST Toolkit)

» Sass as the only dependency - node-sass

» Uses Ems for sizes - sizing on a root & component level

» Unit-less line height - best practice

» Borders in pixels

» Vanilla CSS with Sass Functions over Mixins (Teams)

» http://typesettings.io - PRs Welcome

Page 18: Vertical Rhythm and Modular Scale: Typesettings

How to Setup» Using Bower (better way)

bower install typesettings --save-dev

» Copy/Paste works too (quick and dirty)

Page 19: Vertical Rhythm and Modular Scale: Typesettings

Main.scss@import "_config.scss"; /* Your Sassy Settings For Your Site */@import "_normalize.scss"; /* Your Normalize or Reset */@import "../../bower_components/typesettings/_typesettings.scss";"

/* Your Modules */@import "modules/_site-logo.scss";@import "modules/_story-meta.scss";@import "modules/_flag.scss";@import "modules/_timestamp.scss";@import "modules/_button.scss";

Page 20: Vertical Rhythm and Modular Scale: Typesettings

Config.scss/* Has default settings that can be changed. */

$font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;$font-serif: Georgia, 'Times New Roman', serif;$font-mono: 'Lucida Console', Monaco, monospace;$text-color: #000;

$base-vertical-unit: 6px;

$base-line-multi: 4;

$base-font-size: 16px;

$ms-ratio: 1.414;

$paragraph-indent: true;$paragraph-justify: true;

$load-typesetted: true;

Page 21: Vertical Rhythm and Modular Scale: Typesettings

Skipping to a Button.btn_default { padding-right: emRhythm(2, $ms-down1); padding-left: emRhythm(2, $ms-down1); @include rhythmBorderTop(2px, 1, $ms-down1); @include rhythmBorderBottom(2px, 1, $ms-down1);}

Page 22: Vertical Rhythm and Modular Scale: Typesettings

Live Demo Time» Live Demo, I know...

» Doing it anyway :) http://codepen.io/ianrose/professor/diKpn/