Change the colors and fonts
All colors, fonts, and widths are in _data/theme.yml. You do not need to edit any CSS.
Colors
Each color is a hex code, such as "#1F4E79". Keep the quotation marks.
The template uses the colors in pairs: a text color on a background color. Each pair must have a contrast ratio of at least 4.5:1, so that people with low vision can read the text. Check each pair with a contrast checker, such as the WebAIM Contrast Checker.
| Text color | Background color | Where |
|---|---|---|
text, heading, muted_text, link, link_hover |
page_bg |
Page text |
tint_text, tint_link |
tint |
Disclaimer box and “Last Updated” bar |
masthead_text |
masthead_bg |
Site title |
nav_text, nav_active |
nav_bg |
Menu bar |
search_text |
search_bg |
Search box |
menu_text |
menu_bg and menu_hover_bg |
Dropdown menus |
accent_text |
accent |
Buttons and the search button |
card_text, card_accent |
card_bg |
Home page cards and headline |
footer_text, footer_link |
footer_bg |
Footer |
quick_exit_text |
quick_exit_bg |
Quick Exit button |
The focus outline (the box that shows where the keyboard is) uses focus on light backgrounds and focus_on_dark on dark backgrounds. It must have a contrast ratio of at least 3:1 with the background.
Fonts
The template includes three free fonts, under the SIL Open Font License: Open Sans, Montserrat, and STIX Two Text. They are stored in assets/fonts, so the site does not load fonts from another website.
| Setting | Used for |
|---|---|
fonts.body |
Page text |
fonts.heading |
Headings |
fonts.ui |
Menus, buttons, and labels |
fonts.hero |
The home page headline |
Each setting is a list of fonts, in order of preference. The browser uses the first font it has.
To add a font:
- Get the font as a
.woff2file. Check that its license lets you put it on a website. - Put the file in
assets/fonts, with its license file. - Add the file to
font_filesin_data/theme.yml, with thefamilyname, theweight, and thestyle(normaloritalic). - Put the family name first in one of the
fontssettings.
Other settings
| Setting | What it does |
|---|---|
ui_text_transform |
uppercase makes the menus and buttons all capitals. none keeps them as typed. |
list_style |
The bullets in page text: disc, square, or circle |
layout.content_width |
The widest the page content gets |
layout.sidebar_width |
The width of the left column on wide screens |
The template has square corners everywhere, by design.