• Home
  • Getting started
  • Foundation
    • Accessibility
    • Color
    • Design principles
    • Typography
    • Iconography
    • Pictograms
    • Motion
  • Components
  • Patterns
  • Writing (SE)
  • Brands
Legacy
  • Components

Search the design system

Foundation

Color

Themes replaces Tailwinds default colors and map primitive scales to stable semantic tokens available for all Tailwind prefixes.

Importing themes

Tailwind 4 is required – If your project isn’t on Tailwind 4, please upgrade before proceeding.

Tailwind 4 Setup

Since Tailwind 4 merges configs automatically, you won’t need a separate tailwind.config.js in your project. Instead, ensure Tailwind 4 is set up in your main .css file (or in your chosen bundler config).

Below are examples for Next.js:

  1. Install the necessary Tailwind 4 packages (if you haven’t already):
pnpm install tailwindcss @tailwindcss/postcss postcss
  1. Import your chosen themes in global.css:
@import 'tailwindcss';
// Always import base.css to get all colors and utilities
@import '@svs/ui/tailwind/base.css';
// Always import font.css to get Svenska Spel's custom font
@import '@svs/ui/tailwind/nextjs/font.css';
@import '@svs/ui/tailwind/oddset.css';

/* If you are using components from the svs-ui
   add them as source so Tailwind can find and purge properly */
@source "../../../../packages/ui/";

/* Optional */
body {
  @apply bg-surface-base;
}
  1. To use a theme in your project, simply wrap a high-level node in your application with the theme className of your choice. For example, to use the light theme for our primary product, you would wrap your application in a div with the className "theme-primary-light":
<div className="theme-svs-light">
  {/* Your application components go here */}
</div>

Use multiple themes

It is possible to nest themes to use multiple themes in the same application. For example, you could have a section of your application that uses the vibrant theme while the rest of the application uses the light theme:

<div className="theme-svs-light">
  {/* Light themed components */}
  <div className="theme-svs-vibrant">
    {/* Vibrant themed components */}
  </div>
</div>

Convention

We use a simple color and fg convention for colors where the background is set with the name of the color and text, icons and other elements placed on a background uses the -fg (foreground) variant of the same color.

Below is a list of classNames you can copy and paste for each color. The first example shows which parts are Tailwind prefixes and which parts are variables from @svs/ui themes.

Accent colors

Accent colors are used to give the interface a distinct product identity.

Note that not all themes has mapped colors for secondary-variant and tertiary colors

T

Primary

bg-primary text-primary-fg hover:bg-primary-hover active:bg-primary-pressed
T

Primary-variant

bg-primary-variant text-primary-variant-fg hover:bg-primary-variant-hover active:bg-primary-variant-pressed
T

Secondary

bg-secondary text-secondary-fg hover:bg-secondary-hover active:bg-secondary-pressed
T

Secondary-variant

bg-secondary-variant text-secondary-variant-fg hover:bg-secondary-variant-hover active:bg-secondary-variant-pressed
T

Tertiary

bg-tertiary text-tertiary-fg hover:bg-tertiary-hover active:bg-tertiary-pressed
T

Tertiary-variant

bg-tertiary-variant text-tertiary-variant-fg hover:bg-tertiary-variant-hover active:bg-tertiary-variant-pressed

Status colors

Use to indicate a message to the user.

T

Success

bg-success text-success-fg hover:bg-success-hover active:bg-success-pressed
T

Success variant

bg-success-variant text-success-variant-fg hover:bg-success-variant-hover active:bg-success-variant-pressed
T

Attention

bg-attention text-attention-fg hover:bg-attention-hover active:bg-attention-pressed
T

Attention variant

bg-attention-variant text-attention-variant-fg hover:bg-attention-variant-hover active:bg-attention-variant-pressed
T

Important

bg-important text-important-fg hover:bg-important-hover active:bg-important-pressed
T

Important variant

bg-important-variant text-important-variant-fg hover:bg-important-variant-hover active:bg-important-variant-pressed

Surfaces

Surfaces are the foundational backgrounds for larger UI elements or sections. All surfaces share the same foreground: text-surface-fg

T

Surface-base

bg-surface-base text-surface-fg
T

Surface-standard

bg-surface-standard text-surface-fg
T

Surface-elevated

bg-surface-elevated text-surface-fg text-surface-fg
TT

Surface-inverted

bg-surface-inverted text-surface-inverted-fg
bg-surface-inverted surface-inverted-primary-fg

Layers

All layers share the same foreground: text-layer-fg. Layers are placed upon surfaces.
Layer-neutral is an opacity based layer suitable for both surface-standard and surface-base.

T
T

Neutral

bg-layer-neutral hover:bg-layer-neutral-hover active:bg-layer-neutral-pressed text-layer-fg
T

Contrast-on-base

bg-layer-contrast-on-base hover:bg-layer-contrast-on-base-hover active:bg-layer-contrast-on-base-pressed text-layer-fg
T

Contrast-on-surface

bg-layer-contrast-on-surface hover:bg-layer-contrast-on-surface-hover active:bg-layer-contrast-on-surface-pressed text-layer-fg
T

Transparent

bg-layer-transparent text-surface-fg hover:bg-layer-transparent-hover active:bg-layer-transparent-pressed selected:bg-layer-transparent-selected

Stroke

Use borders according to Tailwinds defaults and set any of the colors below. i.e className="border-4 border-stroke-low"

border-stroke-low
border-stroke-medium
border-stroke-high

Links

link-default
link-primary

Do and don't

Wrap one high-level node with theme-[product]-light
Use semantic utilities (bg-primary, text-success-fg)
Use theme-dark for global dark preference
Wrap one high-level node with theme-[product]-light
Use semantic utilities (bg-primary, text-success-fg)
Use theme-dark for global dark preference
FoundationColor / Color System
Foundation / Design principles

© DesignTech - AB Svenska Spel

What's newTerms of useAccessibility statementCookiesTeams channel [Internal]
@svs/ui version
2.0.5-dev.2

Feedback

We always want to improve the Design System and would be thrilled to get your feedback.

Please share your wisdom with us.

Microsoft Teams [internal]

Designsystem@svenskaspel.se