> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/sdk-core-ui/foundations/colors.md). Agents can also search and read this documentation through its [MCP server](https://docs.rierino.com/~gitbook/mcp).

# Color themes

Change Core UI's colours with CSS variables, and the Rierino palette they fall back to.

Core UI components take their accent and border colours from a small set of CSS variables. When a variable isn't set, the component falls back to the Rierino palette, so the defaults match the admin UI. To theme the components, set those variables. You don't need to change any component code.

## Theme variables

| Variable                  | Default                     | Used for                                                                                                                                                                          |
| ------------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--primary`               | `electric-violet` `#6022F1` | Checked, selected and active states in Checkbox, RadioGroup, Switch, Slider, Rating, Tabs and AutoComplete, the focus border of inputs, the Popover arrow and the Menu background |
| `--primary-fg`            | `#FFFFFF`                   | Text on a `--primary` background (Menu items)                                                                                                                                     |
| `--border-color`          | `hawkes-blue` `#DFEBFB`     | Resting border of TextField, Checkbox, RadioGroup and AutoComplete                                                                                                                |
| `--border-color-focus`    | `--primary`                 | Border of a focused TextField, Checkbox or AutoComplete                                                                                                                           |
| `--border-color-invalid`  | `mandy` `#EB475A`           | Border of a TextField with `isInvalid`                                                                                                                                            |
| `--border-color-disabled` | `hawkes-blue` `#DFEBFB`     | Border of a TextField with `isDisabled`                                                                                                                                           |
| `--global-fg-bright`      | `bright-gray` `#363B4A`     | Tab label text                                                                                                                                                                    |

Values are plain CSS colours: hex, `rgb()`, `hsl()` or `oklch()`.

## Applying a theme

### For the whole app

Set the variables on `:root`, in a stylesheet loaded after `@rierino-open/core-ui/dist/style.css`:

{% code title="theme.css" %}

```css
:root {
  --primary: #0f766e;
  --primary-fg: #ffffff;
  --border-color: #ccfbf1;
  --border-color-invalid: #dc2626;
}
```

{% endcode %}

### For part of a page

The variables are inherited, so setting them on a container themes only what is inside it:

```css
.Rie-Billing-root {
  --primary: #ea580c;
  --border-color-focus: #ea580c;
}
```

```jsx
<div className="Rie-Billing-root">
  <Switch aria-label="Send invoices automatically" />
</div>
```

### Inside Rierino

In Rierino screens, set the variables in the platform's [Styles](https://docs.rierino.com/design/user-interface/styles) feature, not in component code. Every Core UI component on the screen, including the ones in [hosted editors](https://docs.rierino.com/sdk-core-ui/guides/hosted-editors.md), then follows the active theme.

{% hint style="warning" %}
**Buttons use fixed colours**

`Button` doesn't read `--primary`. Its `intent` values map to fixed palette colours and gradients (for example `intent="g-button"`). To recolour one button, set its [`--btn-bg` variable](https://docs.rierino.com/sdk-core-ui/foundations/styling.md#component-variables).
{% endhint %}

## Palette

These are the Rierino colours that the defaults and the `Button` intents come from. Reference them in your own CSS as `var(--color-<name>)`, for example `var(--color-electric-violet)`. These variables are defined on `:root`, so they work anywhere on the page.

Rierino apps also define the same colours as `--colors--<name>`, but only inside the `#root` element. Prefer `--color-<name>`, which works outside Rierino too.

**Violet**

| Name            | Value     | CSS variable                   |
| --------------- | --------- | ------------------------------ |
| tolopea         | `#1B064C` | `var(--color-tolopea)`         |
| paris-m         | `#20075A` | `var(--color-paris-m)`         |
| electric-violet | `#6022F1` | `var(--color-electric-violet)` |
| purple-heart    | `#6C3BDE` | `var(--color-purple-heart)`    |
| heliotrope      | `#9A42FF` | `var(--color-heliotrope)`      |
| indigo          | `#5F59CF` | `var(--color-indigo)`          |
| portage         | `#847EF6` | `var(--color-portage)`         |
| perfume         | `#ADA9F9` | `var(--color-perfume)`         |
| moon-raker      | `#D8CBF6` | `var(--color-moon-raker)`      |
| fog             | `#EAD6FF` | `var(--color-fog)`             |
| blue-chalk      | `#F4F0FF` | `var(--color-blue-chalk)`      |
| magnolia        | `#FBFAFF` | `var(--color-magnolia)`        |

**Blue**

| Name         | Value     | CSS variable                |
| ------------ | --------- | --------------------------- |
| persian-blue | `#261FAD` | `var(--color-persian-blue)` |
| azure        | `#366DBA` | `var(--color-azure)`        |
| pigeon-post  | `#B7B5DE` | `var(--color-pigeon-post)`  |
| periwinkle   | `#BDD8FF` | `var(--color-periwinkle)`   |
| selago       | `#E9E8FC` | `var(--color-selago)`       |
| hawkes-blue  | `#DFEBFB` | `var(--color-hawkes-blue)`  |
| titan-white  | `#F0F0FF` | `var(--color-titan-white)`  |

**Gray**

| Name        | Value     | CSS variable               |
| ----------- | --------- | -------------------------- |
| bright-gray | `#363B4A` | `var(--color-bright-gray)` |
| comet       | `#515A70` | `var(--color-comet)`       |
| lynch       | `#6B7794` | `var(--color-lynch)`       |
| manatee     | `#8F97AE` | `var(--color-manatee)`     |
| mischka     | `#D3D6DF` | `var(--color-mischka)`     |
| athens-gray | `#EDEFF2` | `var(--color-athens-gray)` |
| white       | `#FFFFFF` | `var(--color-white)`       |

**Red and orange**

| Name           | Value     | CSS variable                  |
| -------------- | --------- | ----------------------------- |
| mandy          | `#EB475A` | `var(--color-mandy)`          |
| pink           | `#FFBDC4` | `var(--color-pink)`           |
| azalea         | `#FBDFE2` | `var(--color-azalea)`         |
| coral          | `#FF7E47` | `var(--color-coral)`          |
| romantic       | `#FFD4C2` | `var(--color-romantic)`       |
| peach-schnapps | `#FFE6DB` | `var(--color-peach-schnapps)` |
| forget-me-not  | `#FFF1EB` | `var(--color-forget-me-not)`  |

**Green**

| Name       | Value     | CSS variable              |
| ---------- | --------- | ------------------------- |
| eucalyptus | `#259374` | `var(--color-eucalyptus)` |
| shamrock   | `#33CCA1` | `var(--color-shamrock)`   |
| jagged-ice | `#B4E4D7` | `var(--color-jagged-ice)` |
| polar      | `#E2F8F2` | `var(--color-polar)`      |

## Gradients

Gradients used by `Button` intents and Rierino surfaces. The `intent` of the same name selects one, for example `<Button intent="g-heliotrope">`.

| Name          | Class              | Value                                                               |
| ------------- | ------------------ | ------------------------------------------------------------------- |
| g-button      | `bg-g-button`      | `linear-gradient(178.24deg, #bb00ea 14.34%, #4630da 106.96%)`       |
| g-button2     | `bg-g-button2`     | `linear-gradient(180deg, #6335D0 0%, #4D00FF 100%)`                 |
| g-heliotrope  | `bg-g-heliotrope`  | `linear-gradient(270.53deg, #CB47FF -5.4%, #6B35E9 131.2%)`         |
| g-violet      | `bg-g-violet`      | `linear-gradient(180deg, #7349FD 0%, #511EC8 100%)`                 |
| g-fill        | `bg-g-fill`        | `linear-gradient(180deg, #072982 0%, #5c12d5 40.46%, #a523c6 100%)` |
| g-list        | `bg-g-list`        | `linear-gradient(180deg, #2921a3 0%, #361db0 33.04%, #a351cf 100%)` |
| g-mauve       | `bg-g-mauve`       | `linear-gradient(#9686FE 7%, #BC96FD 55%, #E9C9FD 100%)`            |
| g-manatee     | `bg-g-manatee`     | `linear-gradient(180deg, #8F97AE 0%, #363B4A 125%)`                 |
| g-hawkes-blue | `bg-g-hawkes-blue` | `linear-gradient(347.47deg, #FFFFFF 29.33%, #DFEBFB 90.91%)`        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rierino.com/sdk-core-ui/foundations/colors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
