Skip to content
New: Customize your theme with an AI assistant. Read the guide

Colors & Fonts

Files: src/styles/theme.css, src/config/fonts.json · Skill level: Beginner

A rebrand in Lotline is a handful of values, not a search and replace. Every component uses named color tokens, so changing a token changes it everywhere, including the logo mark, the browser bar color on phones, and the generated social cards. Lotline has one light palette: deep pine, key lime and a soft sage paper.

Lotline homepage with the pine and lime palette

Where The Colors Live

Open src/styles/theme.css. The palette is in the :root { ... } block. Each value is a --theme-* variable. Components never use hex codes. They use Tailwind classes such as bg-surface or text-brand, which read these variables. Change the values and keep the variable names.

The Color Tokens

RoleVariableShips asTailwind classes
Page background--theme-body#ffffffbg-body
Sage paper: soft panels, FAQ rows, review cards--theme-surface#f2f4efbg-surface
Hairlines and 1 px borders--theme-line#e2e6e0border-line
Form field borders--theme-field#7c8780border-field
Headings and body text--theme-ink#0d1614text-ink
Secondary text--theme-muted#58625etext-muted
Secondary text on pine and photos--theme-muted-on-darkwhite at 72%text-muted-on-dark
Pine: dark panels, the brand button, links and icons--theme-brand#18383abg-brand, text-brand
Pine on hover--theme-brand-hover#0f2b2dbg-brand-hover
Text on pine--theme-on-brand#fffffftext-on-brand
Key lime: the main buttons and lime bands--theme-accent#d2f04abg-accent
Lime on hover--theme-accent-hover#c4e43abg-accent-hover
Form and status states--theme-danger, --theme-success, --theme-warning#b42318, #1d6b3a, #8a5300text-danger, …

The form field border (--theme-field) is set to keep at least 3:1 contrast on white and on the sage paper, so people can see where to type. Keep it about as dark if you change it.

Copies To Change With The Palette

A few values appear more than once. Update them with the main tokens:

  • The tone classes under @layer components in theme.css: .panel-brand (pine panel, white text), .panel-photo (white text over a photo), .panel-accent (lime band, ink text) and .panel-surface. They swap the tokens for everything inside them, and a few of them repeat hex values such as #18383a, #0d1614 and #58625e. Cards inside a tone get the page colors back with the values listed under them.
  • --color-scrim in the @theme inline block (#0d1614): the dark wash over photos in page header bands and the photo call to action.
  • The logo files: src/assets/images/favicon.svg, logo.svg and logo-on-dark.svg have the pine and lime written in them. Regenerate the favicon after a color change (see Site Identity & Logo).

The generated social cards and the browser bar color read theme.css during the build, so they follow your tokens without extra work.

Button Styles

Buttons in content files take their look from variant:

You writeButton
variant: "accent"The main action: a lime pill with ink text
variant: "brand"A pine pill with white text
variant: "outline"A pill with a thin line and ink text. It fills with sage on hover
variant: "white"A white pill with ink text, for pine panels and photos
variant: "outline-white"A thin white outline with white text, for pine panels and photos
variant: "text"A text link with an arrow

The older names fill, soft and fill-white still work and map to accent, outline and white. The styles are in src/styles/buttons.css. Some sections pick a variant to fit their background, and the comment next to variant: in the section file says when. For example, the call to action above the footer uses a lime button on its photo and pine layouts and a pine button on its lime layout.

Corners

The radius tokens are in the @theme inline block of theme.css:

TokenValueUsed forClass
--radius-chip0.5rem (8 px)Chips, the button inside a search fieldrounded-chip
--radius-input0.75rem (12 px)Inputs, FAQ rows, menu rows, small imagesrounded-input
--radius-card1rem (16 px)Cards and imagesrounded-card
--radius-panel1.5rem (24 px)The top corners of section panels, review cards, form cardsrounded-panel
--radius-pill9999pxButtons, pill inputs, round icon buttonsrounded-pill

Many sections sit on a panel whose rounded top corners overlap the section above by 24 px. That overlap is --panel-overlap in :root. Lotline uses no shadows: the shadow scales are reset.

Fonts

Lotline uses four fonts from Google Fonts, set in src/config/fonts.json, one entry per role:

FontRolecssVariable
Host GroteskHeadings, body text, buttons and forms--font-primary
Instrument Serif (italic)The one highlighted word in some headings--font-accent
JetBrains MonoCode--font-code
IBM Plex Sans ArabicArabic text, loaded only on Arabic pages--font-arabic
{
"name": "Host Grotesk",
"variants": [{ "style": "normal", "weight": "300 700" }],
"preload": true,
"display": "swap",
"cssVariable": "--font-primary",
"provider": "google",
"subsets": ["latin"],
"fallback": "sans-serif"
}

To change a font, replace name with another Google Font name, exactly as Google writes it ("Inter", "DM Sans"). Keep cssVariable, provider and fallback, and use a weight range the new font has. Add a subset such as "latin-ext" if your language needs it. Then restart npm run dev: fonts are read only when the server starts.

Headings use the same family as the body (--font-heading points at --font-primary in theme.css), so the site loads one main font file. Astro downloads the fonts and serves them from your own site, so visitors don’t load anything from Google.

The accent word. In a heading, wrap one word in single asterisks and it shows in Instrument Serif italic: title: "Find your next home with a *local* agent". This works in H1 and H2 titles. Use it in about a third of headings at most, or it stops standing out. Arabic has no Instrument Serif letters, so on Arabic pages the word keeps the Arabic font in a medium weight. To drop the serif, remove the asterisks, or point the --font-accent entry in fonts.json at your main font.

Type Sizes

Heading sizes are fluid: they grow from phone to desktop between 375 px and 1440 px wide. --text-h1 goes from 44 px to 80 px and --text-display from 44 px to 88 px. They’re in theme.css as --text-display, --text-h1 to --text-h6, --text-stat (big numbers), --text-lead and --text-lead-lg (intro paragraphs), --text-copy (body, 16 px), --text-label (small labels), --text-total and --text-total-lg (prices), and --text-logo (the name next to the mark). Each has a --line-height, --letter-spacing and --font-weight beside it. Large headings use weight 400 with tight letter spacing.

Breakpoints

sm 540 px, md 768 px, lg 1024 px, xl 1320 px. The full header menu shows from lg, and the phone number in the header from xl.

Do It With AI

My brand colors are: dark [HEX] and accent [HEX]. In src/styles/theme.css, in :root, set
--theme-brand to my dark color and --theme-brand-hover a little darker. Set --theme-accent to my
accent and --theme-accent-hover a little darker, and check that #0d1614 text on it has at least
4.5:1 contrast. Update the hex copies of the old pine (#18383a) in the .panel-* tone classes.
Keep every variable name. List the values and their contrast ratios.
Change the main font to [GOOGLE FONT] in src/config/fonts.json. Keep the cssVariable, the
provider and the fallback, and use a weight range the font has. Don't edit CSS files. Then tell
me to restart npm run dev.
Type something to search...