Storybook Not Displaying Custom Themes and Kendo Components Angular v20 #32058
Unanswered
ellieoconnor
asked this question in
Help
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
-
Did you include the style sources in the angular.json styles array for the storybook builders? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
After upgrading to Storybook v9 and reinstalling from scratch to fix unrelated build issues, my Angular 20 application’s themes and Kendo UI components no longer render correctly inside Storybook. There are no console errors, but styles and components (e.g., dialogs, grids) are not displaying as expected. The same components work correctly in the main Angular app. I've confirmed the stylesheets are included and modules are imported properly.
This regression occurred after reinstalling Storybook v9 cleanly. I’ve exhausted troubleshooting steps, including verifying angular.json, module imports, and decorator wrappers.
Additional information
Storybook version number 9.0.13
Angular v20.1.0
Kendo Angular v19.2.0
main.js
/** @type { import('@storybook/angular').StorybookConfig } */ const config = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], addons: [ '@storybook/addon-links', '@storybook/addon-themes', //adds the custom addon for odyssey theme selection. '@chromatic-com/storybook', '@storybook/addon-docs' ], framework: { name: '@storybook/angular', options: {} }, docs: {}, staticDirs: ['../src', '../src/assets'] }; export default config;
preview.js
`
import { Preview } from '@storybook/angular';
import { withThemeByClassName } from '@storybook/addon-themes';
const customViewPorts = {
blInfoDefault: {
name: 'BL Info Default',
styles: {
width: '1920px',
height: '1080px'
}
},
blLaptop: {
name: 'BL Laptop',
styles: {
width: '1519px',
height: '695px'
}
},
tablet: {
name: 'Tablet',
styles: {
width: '768px',
height: '1024px'
}
},
phone: {
name: 'Phone',
styles: {
width: '390px',
height: '844px'
}
}
};
/** @type { import('@storybook/angular').Preview } */
const preview = {
parameters: {
viewport: {
viewports: customViewPorts
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i
}
},
backgrounds: {
default: 'theme-color',
values: [
{
name: 'light',
value: '#ffffff'
},
{
name: 'dark',
value: '#000000'
},
{
name: 'theme-color',
value: 'var(--accentBackgroundColor)'
}
]
}
},
decorators: [
withThemeByClassName({
themes: {
light: 'light-theme',
dark: 'dark-mode'
},
defaultTheme: 'light'
})
]
};
export default preview;
`
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions