Skip to content

Fonts and type ​

The template uses two fonts: Butler for the large serif titles and Urbanist for everything else. Every text takes its font, size and spacing from a type class on its tag, such as display-xl on a page title or label-m on a small label, and each type class reads its values from css/variables.css.

How to access ​

HTML/css/fonts.css for the font files, and HTML/css/variables.css → Fonts and Type styles for the fonts each type class uses and its sizes.

On Studio: the label in label-m, set in Urbanist, and the founder's note in heading-l, set in Butler like the title above it

Swapping a font ​

▶️ Step 1. ​

Put the font's .woff2 files in assets/fonts/. A font from Google Fonts or any other foundry works, as long as its licence lets you use it on a website.

▶️ Step 2. ​

In css/fonts.css, write one @font-face rule per file, as the file's rules for Butler do:

css
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../assets/fonts/cormorant-garamond-light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

▶️ Step 3. ​

In css/variables.css, name it in place of the font it replaces: the heading font for the serif titles, the body font for the rest.

css
--velum-font-family-heading: 'Cormorant Garamond', Georgia, serif;
--velum-font-family-body: 'Urbanist', system-ui, sans-serif;

Every type class that used Butler now uses your font. The titles use the weights 300 and 500, so give the font a file for each.

Straight from Google Fonts

To load a font from Google's servers instead of your own, put the <link> Google Fonts gives you in every page's head, above the line of css/fonts.css, with one search and replace across the pages (Edit every page at once). Then do Step 3.

The type classes ​

ClassFontSize in pixels, small to large window
display-xlheading42 – 144, capitals
display-xl-sansbody32 – 144, capitals
display-lheading38 – 72, capitals
display-s-sansbody30 – 72, capitals
heading-xlbody38 – 72
heading-l, heading-l-mediumheading26 – 48
heading-m, heading-m-semiboldbody22 – 32
heading-m-serifheading22 – 32
paragraphbody18 – 22
body-mbody18
body-s, body-s-boldbody16
quotebodythe size around it
label-m, label-m-boldbody14 – 16, capitals
label-sbody12 – 14, capitals
menu-l, menu-mbody48 – 92 and 32 – 66, capitals: the burger menu's items

A size grows with the window, from the smaller number at 360 pixels wide to the larger at 1920. Text with no type class takes paragraph.

Setting a text in another type class ​

Replace the class on the text's tag, or on the tag around it when the text sits in a component: the founder's note on Studio, set in heading-l, becomes display-s-sans:

html
<div
  class="text-content js-text-content m-first-last-child-0 display-s-sans"
  data-arts-component-name="TextContent"

Changing a type class ​

HTML/css/variables.css → Type styles

Each type class has seven values: its font, smallest and largest size, weight, line height, letter spacing and capitals. Here the page titles stop growing at 120 pixels instead of 144:

css
/* Display / XL */
--display-xl-font-family: var(--velum-font-family-heading);
--display-xl-min-font-size: 42;
--display-xl-max-font-size: 120;

A size has no unit: it is pixels.

Next: Spacing and layout.