Colours and themes

Semantic tokens define background, text, accent and state colours. Switching a theme changes token values while preserving component contracts and interface meaning.

Core color tokens

Choose a color by its role. Switch themes in the header to compare the same roles in another palette.

Surfaces

  • Page background--wl-bg
    #ffffff
  • Card background--wl-bg-raised
    #ffffff
  • Secondary background--wl-bg-soft
    #f0efff
  • Hover--wl-bg-hover
    #d4d3ed

Text and borders

  • Main text--wl-text
    #201e33
  • Captions--wl-text-muted
    #4e5765
  • Border--wl-border
    #dce0e4
  • Keyboard focus--wl-focus-color
    #343289

Actions

  • Accent--wl-accent
    #343289
  • Soft highlight--wl-accent-soft
    #f0efff
  • Primary button background--wl-action-primary-bg
    #343289
  • Primary button text--wl-action-primary-text
    #ffffff

Statuses

  • Information--wl-info-text
    #2160bd
  • Success--wl-success
    #2e9e68
  • Warning--wl-warn
    #99500d
  • Error or deletion--wl-danger
    #b32149

Button tones

Themes

Current theme: Legato. Change the theme in the header to update every role below.

Legato

A light theme with indigo, burgundy and saffron accents and the Legato Sans typeface.

Primary action

bg: #ffffff

text: #201e33

Legato Dark

A dark theme with ink-colored surfaces, pale indigo, rose and saffron accents, and the Legato Sans typeface.

Primary action

bg: #14141c

text: #ebe9ef

Classic

Light theme with a blue accent.

Primary action

bg: #ffffff

text: #22252b

Classic Dark

Dark theme with status colors.

Primary action

bg: #17181c

text: #e8eaee

Foundation stores source values, semantic defines their purpose, and component applies them to an element. Use semantic variables to style your application.

Importing CSS

Import styles explicitly and set data-wl-theme on the root element. To switch between themes, import their CSS once and change the attribute.

main.ts · current theme
import { createApp } from "vue";
import "legato-ui/styles/reset.css";
import "legato-ui/styles/base.css";
import "legato-ui/styles/primitives.css";
import "legato-ui/styles/fonts/legato.css";
import "legato-ui/themes/legato.css";
import App from "./App.vue";

document.documentElement.dataset.wlTheme = "legato";
createApp(App).mount("#app");

Semantic tokens on this page: 37. Values come from the current theme catalogue; local application CSS overrides may differ.

Surfaces

Primary and secondary surfaces, hover and specialised backgrounds. Choose a matching foreground role for text.

Show all tokens in this group
var(--wl-bg)

Primary page and content surface.

Value
#ffffff
Source
var(--wl-palette-bg)
var(--wl-bg-soft)

Grouped blocks and secondary surfaces.

Value
#f0efff
Source
var(--wl-palette-bg-soft)
var(--wl-bg-hover)

Interactive element surface on hover.

Value
#d4d3ed
Source
var(--wl-palette-bg-hover)
var(--wl-mask-bg)

Modal backdrop dimming.

Value
rgba(24, 26, 32, 0.24)
Source
var(--wl-palette-mask-bg)
var(--wl-avatar-bg)

Colour of the avatar-bg role.

Value
#2c2f36
Source
var(--wl-palette-avatar-bg)
var(--wl-tooltip-bg)

Tooltip surface.

Value
#201e33
Source
var(--wl-palette-tooltip-bg)

Text

Body text, descriptions, less prominent labels, errors and tooltip text. Required instructions must remain readable.

Show all tokens in this group
var(--wl-text)

Readable primary text.

Value
#201e33
Source
var(--wl-palette-text)
var(--wl-text-2)

Readable secondary text and labels.

Value
#4e5765
Source
var(--wl-palette-text-2)
var(--wl-text-3)

Muted decorative metadata; not for required instructions.

Value
#4e5765
Source
var(--wl-palette-text-3)
var(--wl-text-muted)

Supporting text with at least 4.5:1 contrast.

Value
#4e5765
Source
var(--wl-text-2)
var(--wl-text-danger)

Readable error text on the primary surface.

Value
#9e1d46
Source
var(--wl-err-text)
var(--wl-tooltip-text)

Tooltip text.

Value
#ffffff
Source
var(--wl-palette-tooltip-text)

Accent

Action accent and its states. Use a soft background and borders for emphasis without a solid fill.

Show all tokens in this group
var(--wl-accent)

Accent for selection, links and primary actions.

Value
#343289
Source
var(--wl-palette-accent)
var(--wl-accent-hover)

Accent on hover.

Value
#2b2970
Source
var(--wl-palette-accent-hover)
var(--wl-accent-soft)

Colour of the accent-soft role.

Value
#f0efff
Source
var(--wl-palette-accent-soft)
var(--wl-accent-soft-hover)

Colour of the accent-soft-hover role.

Value
#d8d6f0
Source
var(--wl-palette-accent-soft-hover)
var(--wl-accent-border)

Colour of the accent-border role.

Value
#b0afd7
Source
var(--wl-palette-accent-border)
var(--wl-accent-border-hover)

Colour of the accent-border-hover role.

Value
#343289
Source
var(--wl-palette-accent-border-hover)

Status

Success, warning and error states include clear text. Choose soft backgrounds, borders and foreground roles together.

Show all tokens in this group
var(--wl-success)

Successful result signal.

Value
#2e9e68
Source
var(--wl-palette-success)
var(--wl-success-soft)

Colour of the success-soft role.

Value
#eaf6f0
Source
var(--wl-palette-success-soft)
var(--wl-success-border)

Colour of the success-border role.

Value
#cdeadb
Source
var(--wl-palette-success-border)
var(--wl-warn)

Warning signal.

Value
#99500d
Source
var(--wl-palette-warn)
var(--wl-warn-soft)

Colour of the warn-soft role.

Value
#fff2df
Source
var(--wl-palette-warn-soft)
var(--wl-warn-border)

Colour of the warn-border role.

Value
#e3b279
Source
var(--wl-palette-warn-border)
var(--wl-danger)

Dangerous action or error signal.

Value
#b32149
Source
var(--wl-palette-danger)
var(--wl-danger-hover)

Colour of the danger-hover role.

Value
#93193e
Source
var(--wl-palette-danger-hover)
var(--wl-danger-soft)

Colour of the danger-soft role.

Value
#fcecf2
Source
var(--wl-palette-danger-soft)
var(--wl-danger-soft-hover)

Colour of the danger-soft-hover role.

Value
#f7dce6
Source
var(--wl-palette-danger-soft-hover)
var(--wl-danger-border)

Colour of the danger-border role.

Value
#dca3b6
Source
var(--wl-palette-danger-border)
var(--wl-info-text)

Colour of the info-text role.

Value
#2160bd
Source
var(--wl-palette-info-text)
var(--wl-ok-text)

Colour of the ok-text role.

Value
#216044
Source
var(--wl-palette-ok-text)
var(--wl-warn-text)

Colour of the warn-text role.

Value
#884506
Source
var(--wl-palette-warn-text)
var(--wl-err-text)

Colour of the err-text role.

Value
#9e1d46
Source
var(--wl-palette-err-text)

Borders and focus

Regular and strong borders separate surfaces. Visible focus identifies the keyboard-selected element in every theme.

Show all tokens in this group
var(--wl-border)

Subtle surface dividers.

Value
#dce0e4
Source
var(--wl-palette-border)
var(--wl-border-2)

Strong group border.

Value
#79838d
Source
var(--wl-palette-border-2)
var(--wl-focus-color)

Visible keyboard focus outline.

Value
#343289
Source
var(--wl-accent)
var(--wl-focus-invalid-color)

Focus outline for an invalid field.

Value
#93193e
Source
var(--wl-danger-hover)

Colour in the interface

State names, counts and messages must be clear without colour. Check readability on the intended surface and keep focus visible.

Surfaces and text roles

Team materials

Body text uses --wl-text on --wl-bg.

The explanation inherits --wl-text-muted; the border uses --wl-border.

Selected section

Soft highlight: --wl-accent-soft and --wl-accent-border. The title remains visible text.

The secondary area uses --wl-bg-soft. CSS stays the same when switching themes.

Vue SFC · application example
<script setup lang="ts">
</script>

<template>
  <section class="color-roles-example wl-stack" data-space="lg">
    <article class="color-roles-example-surface wl-stack" data-space="md">
      <h4 class="wl-text-subheading">{{ "Team materials" }}</h4>
      <p class="wl-text-body">{{ "Body text uses --wl-text on --wl-bg." }}</p>
      <p class="wl-text-small wl-text-muted">
        {{ "The explanation inherits --wl-text-muted; the border uses --wl-border." }}
      </p>
    </article>
    <div class="color-roles-example-accent wl-stack" data-space="sm">
      <h4 class="wl-text-label">{{ "Selected section" }}</h4>
      <p class="wl-text-small">{{ "Soft highlight: --wl-accent-soft and --wl-accent-border. The title remains visible text." }}</p>
    </div>
    <p class="color-roles-example-help wl-text-small">
      {{ "The secondary area uses --wl-bg-soft. CSS stays the same when switching themes." }}
    </p>
  </section>
</template>

<style scoped>
.color-roles-example { min-width: 0; }
.color-roles-example-surface {
  min-width: 0;
  padding: var(--wl-space-lg);
  background: var(--wl-bg);
  color: var(--wl-text);
  border: 1px solid var(--wl-border);
  border-radius: var(--wl-corner-surface);
}
.color-roles-example-accent {
  min-width: 0;
  padding: var(--wl-space-md);
  background: var(--wl-accent-soft);
  color: var(--wl-text);
  border: 1px solid var(--wl-accent-border);
  border-radius: var(--wl-corner-control);
}
.color-roles-example-help {
  padding: var(--wl-space-md);
  background: var(--wl-bg-soft);
  color: var(--wl-text-muted);
  border-radius: var(--wl-corner-control);
}
</style>

State, message and count

Material in progress
Add a description before submitting for review.

Materials saved: 0 · State: Information

The state name, text and number are understandable without color. Actions work only in this example.

Vue SFC · application example
<script setup lang="ts">
import { WlAlert, WlButton, WlSegmented } from "legato-ui";
import { computed, ref } from "vue";
const definitions = {
  info: { label: "Information", title: "Material in progress", text: "Add a description before submitting for review." },
  success: { label: "Success", title: "Material ready", text: "All required fields are filled." },
  warning: { label: "Warning", title: "Needs review", text: "Check the date before saving." },
  danger: { label: "Error", title: "Could not save", text: "Your entries remain in the form. Save again." }
} as const;
type StatusName = keyof typeof definitions;
const selected = ref<string | null>("info");
const saved = ref(0);
const options = Object.entries(definitions).map(([value, definition]) => ({ value, label: definition.label }));
const status = computed<StatusName>(() => typeof selected.value === "string" && selected.value in definitions ? selected.value as StatusName : "info");
const current = computed(() => definitions[status.value]);
</script>

<template>
  <section class="wl-stack" data-space="lg">
    <WlSegmented v-model="selected" :options="options" aria-label="Material status" />
    <WlAlert :tone="status" :title="current.title">{{ current.text }}</WlAlert>
    <div><WlButton variant="primary" @click="saved++">{{ "Save example" }}</WlButton></div>
    <p class="wl-text-small" role="status">
      {{ "Materials saved:" }} {{ saved }} {{ "· State:" }} {{ current.label }}
    </p>
    <p class="wl-text-small wl-text-muted">{{ "The state name, text and number are understandable without color. Actions work only in this example." }}</p>
  </section>
</template>