# Colors & Fonts

## Colors & Fonts

**Files:** `src/styles/theme.css`, `src/config/fonts.json`, `src/config/config.toml` (`[settings]`, `[settings.colorScheme]`) · **Skill level:** Beginner

A rebrand in Givo 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 heart in the wordmark and the generated social cards. Givo has a light palette, a dark palette, and a forest-green band palette.

<div class="border border-dark">
  ![Givo homepage in dark mode](/images/givo/dark-mode.jpg)
</div>

### Where The Colors Live
Open `src/styles/theme.css`. The values are in three blocks:

- `:root { ... }`: the **light** palette (the default)
- `:root.dark { ... }`: the **dark** palette
- `.band-ink { ... }`: the **forest band** palette, used inside the footer, the stats bands, and the other solid green blocks

Each value is a `--theme-*` variable. Components never use hex codes: they use Tailwind classes such as `bg-band` or `text-primary`, which read these variables. Change a value in every block where it appears, and keep the variable names.

Givo uses three colors with fixed jobs: **green** for actions, links, and progress bars; **gold** for the donation panel and small highlights; **forest** for solid bands such as the footer and stats.

### The Color Tokens
| Role                                   | Variable                | Light     | Dark      |
| -------------------------------------- | ----------------------- | --------- | --------- |
| Page background                        | `--theme-body`          | `#fbfcfa` | `#0b1712` |
| Cards and forms                        | `--theme-card`          | `#ffffff` | `#10221a` |
| Green tint (chips, selected rows)      | `--theme-light`         | `#edf5f0` | `#163527` |
| Soft mint-grey panel                   | `--theme-mint`          | `#eef3f0` | `#13261d` |
| Pale gold panel                        | `--theme-cream`         | `#faf2e1` | `#2a2314` |
| **Green** (buttons, links, progress)   | `--theme-primary`, `--theme-accent` | `#087f44` | `#2fbf73` |
| Green on hover                         | `--theme-primary-hover`, `--theme-accent-hover` | `#06713c` | `#4fd08a` |
| Text on green                          | `--theme-on-primary`, `--theme-on-accent` | `#ffffff` | `#0b1712` |
| **Gold** (donation panel, small marks) | `--theme-gold`          | `#e6b35a` | `#e6b35a` |
| Text on gold                           | `--theme-on-gold`       | `#0f2a1f` | `#0f2a1f` |
| Amber (small accent text)              | `--theme-amber`         | `#9a5c12` | `#e3a04b` |
| **Forest** (bands, footer)             | `--theme-band`, `--theme-deep` | `#0f2a1f` | `#08130e` |
| Text on forest                         | `--theme-on-band`       | `#f3f7f4` | `#eaf2ee` |
| Headings (forest ink)                  | `--theme-dark`          | `#0f2a1f` | `#eaf2ee` |
| Body text                              | `--theme-text-default`  | `#2f4a3e` | `#c9d8d1` |
| Secondary text                         | `--theme-muted`         | `#56675f` | `#9fb3aa` |
| Borders and dividers                   | `--theme-border-light`  | `#dce5e0` | `#22382e` |
| Form field borders                     | `--theme-border-input`  | `#7c8e85` | `#5e7a6d` |
| Focus ring                             | `--theme-focus`         | `#087f44` | `#2fbf73` |
| Pattern tint                           | `--theme-pattern`       | `#0f2a1f` | `#eaf2ee` |
| States                                 | `--theme-danger`, `--theme-success`, `--theme-warning` | `#b42318`, `#0b7240`, `#9a5c12` | `#f2726a`, `#4fd08a`, `#e3a04b` |

`--theme-blush` and `--theme-primary-soft` repeat the green tint, and `--theme-sage` and `--theme-sand` repeat the mint-grey panel. Change them together with `--theme-light` and `--theme-mint`. Some token names (`sage`, `cream`, `deep`) are kept from older versions: the comment at the top of `theme.css` says what each one is now.

<Aside type="note" title="Gold is never text on white">
  The gold `#e6b35a` has a contrast of about 1.9:1 on white, so Givo uses it
  only as a fill (the donation panel, small marks) with forest text on it
  (8:1). For small accent text on light backgrounds it uses amber
  (`--theme-amber`). Keep that rule if you change the gold.
</Aside>

### Copies To Change With The Palette
A few values appear more than once in `theme.css`. Update them with the main tokens:

- **`--page-*` variables** at the end of `:root` and `:root.dark` (`--page-primary`, `--page-dark`, `--page-text`, ...). Cards on a colored block use them to get the page colors back. Keep them equal to the matching `--theme-*` values.
- **The forest band** (`.band-ink`, and the block after it): the palette inside the footer and the other forest bands. Links and small accents turn gold there, and buttons turn bright green with a dark label.
- **Static helpers** in the `@theme inline` block, which stay the same in light and dark mode: `--color-emerald` (`#087f44`), `--color-sunflower` (`#2fbf73`, bright green on forest), `--color-mist` (`#eef3f0`), `--color-light` (`#d2e0d9`, light text on forest), `--color-body-dark` (`#0f2a1f`), `--color-gold-hover`, and `--color-amber-solid`.

The green and forest colors also appear in `src/assets/images/favicon.svg` and the two standalone logo files. Regenerate the favicon after a color change (see [Site Identity & Logo](/givo/customization/site-identity-logo/#favicons)).

### Button Styles
Buttons in content files take their look from `variant`:

| You write               | Button                                                              |
| ----------------------- | ------------------------------------------------------------------- |
| `variant: "fill"`       | The main action: a dark forest pill. On forest bands it turns bright green |
| `variant: "accent"`     | A green pill with a white label, for money actions such as **Donate** |
| `variant: "gold"`       | A gold pill with a forest label, for the donation panel             |
| `variant: "outline"`    | A white pill                                                        |
| `variant: "soft"`       | A green tint pill                                                   |
| `variant: "fill-white"` | A white pill, for photos and forest bands                           |
| `variant: "link"`       | Underlined text                                                     |
| `variant: "text"`       | A text link with an arrow                                           |
| `variant: "ink"`        | The same as `fill`, kept for older content                          |

`arrow: true` on a button adds a small round arrow button of the same color after the pill. The styles are in `src/styles/buttons.css`. See [Common Changes](/givo/customization/common-changes/) for every button option.

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

| Token             | Value             | Used for                                      | Class           |
| ----------------- | ----------------- | --------------------------------------------- | --------------- |
| `--radius-btn`    | `9999px` (a pill) | Buttons, chips, badges, icon buttons          | `rounded-btn`   |
| `--radius-field`  | `9999px` (a pill) | Inputs and selects (text areas use `rounded-ui`) | `rounded-field` |
| `--radius-ui`     | `1.5rem` (24 px)  | Cards, tiles, large photos                    | `rounded-ui`    |
| `--radius-panel`  | `2rem` (32 px)    | Panels, stat cards, the hero photo            | `rounded-panel` |
| `--radius-block`  | `2rem` (32 px)    | Color blocks                                  | `rounded-block` |
| `--radius-inset`  | `1.25rem` (20 px) | An image inside a card                        | `rounded-inset` |
| `--radius-tile`   | `0.875rem` (14 px) | Icon tiles                                   | `rounded-tile`  |
| `--radius-tag`    | `0.375rem` (6 px) | Check squares and small marks                 | `rounded-tag`   |

For square buttons, for example, set `--radius-btn: 0.5rem;`. Givo uses no shadows and no gradients: the shadow scales are reset.

### Background Patterns
Givo draws faint organic patterns (small hearts, leaf sprigs, a flowing vine, and a soft wave) on the edges of the heroes, the soft panels, the gold donation panel, the forest bands, the page headers, and a corner of the footers. Text always sits on the solid color: the lines only show around it.

```toml
# src/config/config.toml
[settings]
  patterns = "organic"   # "organic" | "none"
```

- `patterns = "none"` turns them off on every page.
- Their color and strength are `--theme-pattern` and `--theme-pattern-opacity` in `theme.css`: `0.06` in light mode and `0.07` in dark mode and on forest bands. Lower the opacity for a quieter look.
- Where they appear is set in `src/styles/patterns.css`. The drawings are in `src/assets/patterns/`.
- Visitors who ask their device for more contrast never see them.

### Fonts
Givo uses three fonts from Google Fonts, set in `src/config/fonts.json`, one entry per role:

| Font           | Role                                       | `cssVariable`     |
| -------------- | ------------------------------------------ | ----------------- |
| Urbanist       | Headings, body text, numbers, and forms    | `--font-primary`  |
| Readex Pro     | Arabic text                                | `--font-arabic`   |
| JetBrains Mono | Code                                       | `--font-code`     |

```json
{
  "name": "Urbanist",
  "variants": [{ "style": "normal", "weight": "400 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 (`"DM Sans"`, `"Plus Jakarta Sans"`). Keep `cssVariable`, `provider`, and `fallback`, and keep 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 `--font-heading`, which `theme.css` points at `--font-primary`. For a separate heading font, add an entry with `"cssVariable": "--font-heading"` to `fonts.json`, and remove the line `--font-heading: var(--font-primary);` from `theme.css`.

Astro downloads the fonts and serves them from your own site, so visitors don't load anything from Google.

### Type Sizes
Heading sizes are fluid: they grow from phone to desktop between 375 px and 1280 px wide (`--text-h1` from 36 px to 52 px, `--text-display` from 40 px to 72 px). They are in `theme.css` as `--text-display`, `--text-h1` to `--text-h6`, `--text-stat` (big numbers), and the body sizes. Each has a `--line-height`, `--letter-spacing`, and `--font-weight` beside it.

### Breakpoints
`sm` 540 px, `md` 768 px, `lg` 1024 px, `xl` 1320 px. The mobile donate bar shows below `md`.

### Dark Mode
```toml
# src/config/config.toml
[settings.colorScheme]
  default  = "light" # system | light | dark: used until a visitor picks one
  switcher = true     # Show the light/dark button in the header, mobile menu, and footer
```

- Givo ships with `light`. `system` follows the visitor's device setting, and `light` or `dark` starts every visitor on that palette.
- The sun and moon button switches it. The visitor's choice is remembered in their browser.
- `switcher = false` hides every button. Visitors then always get `default`. Use `switcher = false` with `default = "light"` for a site without dark mode.

When you change colors, check both palettes and the forest bands. Photos stay the same in dark mode.

### Do It With AI
```text
My brand colors are: main [HEX], dark band color [HEX], and highlight [HEX]. In
src/styles/theme.css, in :root, set --theme-primary and --theme-accent to my main color (darken
it if needed for at least 4.5:1 contrast on #ffffff and #eef3f0), their hover values to a
darker shade, --theme-band, --theme-deep, and --theme-dark to my band color, and --theme-gold
to my highlight. Make matching versions for :root.dark and .band-ink, and update the --page-*
values and --color-emerald. Keep every variable name. List the values and their contrast ratios.
```

```text
Change the font to [GOOGLE FONT] in src/config/fonts.json (the --font-primary entry). 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.
```