-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Open
Description
Describe the problem
I am using Storybook v20 (CSF next) + Angular v21 (library)
I followed the theming documentation https://storybook.js.org/docs/essentials/themes
I could choose a dark theme, but cannot switch between dark and light!
The theme toggle appears in the toolbar, however, toggling it doesn't do what is written in the docs, it doesn't apply a class anywhere in the DOM
Preview.ts
import { definePreview } from '@storybook/angular';
import { setCompodocJson } from '@storybook/addon-docs/angular';
import docJson from '../documentation.json';
import addonDocs from '@storybook/addon-docs';
import addonA11y from '@storybook/addon-a11y';
import addonThemes from '@storybook/addon-themes';
import { withThemeByClassName } from '@storybook/addon-themes'
import { themes } from 'storybook/theming';
setCompodocJson(docJson);
export default definePreview({
tags: ['autodocs'],
addons: [
addonDocs(),
addonA11y(),
addonThemes()
],
parameters: {
docs: {
theme: themes.dark,
},
},
decorators: [
withThemeByClassName({
themes: {
light: 'light-theme',
dark: 'dark-theme',
},
defaultTheme: 'dark',
}),
]
});main.ts
import { defineMain } from '@storybook/angular/node';
import remarkGfm from "remark-gfm";
export default defineMain({
stories: [
'../src/**/*.mdx',
'../src/**/*.stories.@(ts|tsx)'
],
addons: [
'@storybook/addon-a11y',
'@storybook/addon-themes',
{
name: '@storybook/addon-docs',
options: {
mdxPluginOptions: {
mdxCompileOptions: {
remarkPlugins: [remarkGfm],
},
},
},
}
],
framework: '@storybook/angular'
});manager.ts
import { addons } from 'storybook/manager-api';
import { themes } from 'storybook/theming';
addons.setConfig({
theme: themes.dark
});Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
No status