Add modes + a11y

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
Charles de Dreuille
2025-09-15 21:26:08 +01:00
parent 9320b11e33
commit 15de5ccd86
5 changed files with 47 additions and 4 deletions
+1
View File
@@ -41,6 +41,7 @@ const config: StorybookConfig = {
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-themes'),
getAbsolutePath('@storybook/addon-docs'),
getAbsolutePath('@storybook/addon-a11y'),
],
framework: {
name: getAbsolutePath('@storybook/react-vite'),
+18
View File
@@ -0,0 +1,18 @@
export const allModes = {
'light backstage': {
themeMode: 'light',
themeName: 'backstage',
},
'dark backstage': {
themeMode: 'dark',
themeName: 'backstage',
},
'light spotify': {
themeMode: 'light',
themeName: 'spotify',
},
'dark spotify': {
themeMode: 'dark',
themeName: 'spotify',
},
} as const;
+10
View File
@@ -5,6 +5,7 @@ import { apis } from './support/apis';
import type { Decorator, Preview } from '@storybook/react-vite';
import { useGlobals } from 'storybook/preview-api';
import { UnifiedThemeProvider, themes } from '@backstage/theme';
import { allModes } from './modes';
// Default Backstage theme CSS (from packages/ui)
import '../packages/ui/src/css/styles.css';
@@ -90,6 +91,15 @@ const preview: Preview = {
docs: {
codePanel: true,
},
chromatic: {
modes: {
'light backstage': allModes['light backstage'],
'dark backstage': allModes['dark backstage'],
'light spotify': allModes['light spotify'],
'dark spotify': allModes['dark spotify'],
},
},
},
decorators: [
Story => {