GitHub

Themes & Styling

Color themes, dark mode controls, and accessibility specifications in Zen Reports.

Zen Reports for Playwright provides three nature-inspired color themes designed for data clarity and extended debugging sessions.


Color Themes

  • Bamboo (Default): Crisp, calm eucalyptus green and slate neutrals.
  • Lotus: Warm plum, deep indigo, and vibrant lime accents.
  • Oasis: Electric blue, ultramarine, and deep navy tones.

To specify the initial theme for generated reports, set the theme property:

import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
[
'@zen-reports/zen-reporter-playwright',
{
theme: 'Oasis',
},
],
],
});

Unrecognized or legacy theme names safely fall back to "Bamboo" and display a gentle toast notification in the dashboard.


Dark & Light Mode

The darkMode option controls the initial color scheme applied when opening the dashboard:

export default defineConfig({
reporter: [
[
'@zen-reports/zen-reporter-playwright',
{
darkMode: 'system', // 'system' | 'light' | 'dark' | boolean
},
],
],
});
  • 'system' (Default): Automatically synchronizes with the user’s operating system preference (prefers-color-scheme).
  • 'dark' or true: Forces dark mode upon initial report load.
  • 'light' or false: Forces light mode upon initial report load.
Theme and dark mode toggle controls in the dashboard header
Header controls: Bamboo / Lotus / Oasis themes and System / Light / Dark modes.

Client-Side Persistence

When users manually toggle the theme or dark mode switcher in the dashboard header, their choice is saved to the browser’s localStorage under zen-theme. This ensures individual user preferences persist across test runs, overriding the initial configuration default.