Typography

Housekeeping

  1. Recommendations from Dailies
  2. Tool Time: Can I Use?

Homework

  1. Review
  2. Tool Time
  3. Web Typography
  4. Fluid Typography
  5. Icon fonts and HTML Entities
  6. Units

1. Font fallbacks and overrides

Terms

Inheritance
When CSS property values set on parent elements are inherited by their child elements. Most font settings are inherited.
Fallback
A default setting or configuration that activates when a CSS declaration fails.
CSS Override
A aspect of the cascade where a previous CSS declaration is overwritten by another that has higher priority/specificity.

Materials


2. Readable Text

Materials


3. Font-based units

Materials


Activities

Font-family pairings

In groups of 3-4, create two to three font pairings using Google Fonts with system and generic families as fallbacks. See Web Typography Cheatsheet.

  1. Create a css file that embeds your favourite google font pairing using the @import rule:

     @import url('https://fonts.googleapis.com/css2?family=Karla&family=Raleway:wght@300;400&display=swap');
    
  2. Declare your main body text font family using the font-family declaration and a type selector on the body tag. Include settings for line-height (default is 1.2; try for 1.5-2) and increase the font-size to something larger than 16px (the default on most browsers):

     body {
       font-family: 'Karla', sans-serif;
       font-size: 18px;
       line-height: 1.6;
     }
    
  3. Declare a secondary font on your headings using a group selector:

     h1, h2, h3, h4, h5, h6 {
       font-family: 'Raleway', sans-serif;
    
       /* Sometimes needed, depending on the font that you ebmedded. */
       font-weight: 300; 
     }
    
  4. Add fallbacks for system fonts. See Web-safe Font Stacks.
  5. Level-up: Add visual hierarchy to your headings with one of more of the following “fancy” declarations:
    • font-variant
    • word-spacing
    • letter-spacing
    • initial-letter
      • Note: this declaration has limited browser support at this time.
  6. Level-up: How big can you go? Refer back to the Visual Hierarchy Cheatsheet. How can you use typography and box model declarations to replicate some of these examples of visual hierarchy?
  7. Level-up: Style a blockquote with pseudo-elements
  8. Level-up: Customize your list styling
  9. Level-up: Add HTML Entities to your document.
  10. Level-up: Try adding Font Awesome Icons. Hint: it’s often easier to embed FA using CDNJS.

Cleanup Time

  • Submit today’s Codepen to the Dailies section (in Assessments) in Brightspace.