DDS/Theming

Theming

DDS uses CSS custom properties as the single source of truth for all visual decisions. Override any token in your project CSS to instantly retheme every component.

Change the primary color

Override --ds-primary and its variants in a CSS file to apply your brand color across all components at once.

app/assets/theme.css
/* app/assets/theme.css */
:root {
  /* Example: blue brand color */
  --ds-primary: #0070f3;
  --ds-primary-hover: #0060df;
  --ds-primary-active: #0050bb;
  --ds-primary-subtle: #e8f1ff;
  --ds-primary-muted: #cce0ff;
  --ds-primary-fg: #ffffff;
  --ds-ring: #0070f3;
}

/* Dark mode variant */
.dark {
  --ds-primary: #60a5fa;
  --ds-primary-hover: #93c5fd;
  --ds-primary-subtle: #0c1d3e;
  --ds-primary-muted: #1a3366;
  --ds-ring: #60a5fa;
}

Then import it in your Nuxt config:

nuxt.config.ts
// nuxt.config.ts
export default defineNuxtConfig({
  css: ['~/assets/theme.css'],
})

Dark mode

Dark mode is activated by toggling the .dark class on the <html> element. All tokens have dark-mode values built in — no extra CSS required.

vue
<script setup lang="ts">
const isDark = ref(false)

function toggleDark() {
  isDark.value = !isDark.value
  document.documentElement.classList.toggle('dark', isDark.value)
}
</script>

<template>
  <DsButton variant="ghost" @click="toggleDark">
    {{ isDark ? 'Light mode' : 'Dark mode' }}
  </DsButton>
</template>

Override border radius

The radius scale can be made sharper or rounder by overriding the radius tokens.

css
/* Sharper corners */
:root {
  --ds-radius-xs: 2px;
  --ds-radius-sm: 3px;
  --ds-radius-md: 4px;
  --ds-radius-lg: 6px;
  --ds-radius-xl: 8px;
  --ds-radius-2xl: 10px;
}

/* Rounder corners */
:root {
  --ds-radius-xs: 6px;
  --ds-radius-sm: 10px;
  --ds-radius-md: 14px;
  --ds-radius-lg: 20px;
  --ds-radius-xl: 28px;
  --ds-radius-2xl: 36px;
}

Token reference

TokenDefault (light)Description
--ds-primary#7f00ffPrimary brand color
--ds-primary-hover#7000e0Primary hover state
--ds-primary-active#6000c2Primary active/pressed state
--ds-primary-fg#ffffffText on primary background
--ds-primary-subtle#f5f0ffSubtle primary background
--ds-primary-muted#ede0ffMuted primary background
--ds-bg#ffffffPage background
--ds-bg-subtle#fafafaSubtle background (sidebar, etc.)
--ds-bg-muted#f4f4f5Muted background (inputs, etc.)
--ds-bg-elevated#ffffffElevated surface (cards, popovers)
--ds-fg#09090bPrimary text
--ds-fg-muted#71717aSecondary/muted text
--ds-fg-subtle#a1a1aaSubtle/placeholder text
--ds-border#e4e4e7Default border color
--ds-border-muted#f4f4f5Subtle border
--ds-border-strong#a1a1aaStrong border
--ds-ring#7f00ffFocus ring color
--ds-danger#ef4444Error/danger
--ds-success#22c55eSuccess
--ds-warning#f59e0bWarning
--ds-info#3b82f6Informational
--ds-radius-sm6pxSmall radius
--ds-radius-md8pxMedium radius
--ds-radius-lg12pxLarge radius
--ds-radius-xl16pxExtra large radius
--ds-radius-full9999pxFull/pill radius

Full reference: node_modules/design-system-antoinegourgue/dist/runtime/assets/base.css