Open UltimateGG opened 3 months ago
Disclaimer This information might be inaccurate, due to it being generated automatically
To resolve the issue with CSS vars in the theme throwing errors when 'Show Code' is clicked, ensure that the theme object passed to Storybook's theming API does not contain any CSS variables directly. Instead, resolve the CSS variables to their actual values before passing them to the theme. Update your theme configuration in .storybook/YourTheme.js
to use static values or resolve the CSS variables programmatically.
/.github/DISCUSSION_TEMPLATE/help.yml /.github/comments/invalid-link.md /.github/DISCUSSION_TEMPLATE/ideas.yml /code/core/src/server-errors.ts /code/core/src/manager/components/notifications/NotificationItem.tsx /docs/_snippets/configure-mock-provider-with-story-parameter.md /code/core/src/preview-errors.ts /.github/DISCUSSION_TEMPLATE/rfc.yml /.github/comments /code/addons/docs/template/stories/docspage /code/core/src/manager/components/sidebar/Brand.tsx /code/core/src/core-server/utils/mockdata/errors/NoMeta.stories.ts /docs/_snippets/storybook-canvas-doc-block-story.md /code/core/scripts/helpers/modifyThemeTypes.ts /code/core/src/theming/convert.ts /docs/configure/user-interface/theming.mdx /docs/_snippets/your-theme.md /test-storybooks/server-kitchen-sink/stories/html_content/styles.stories.json /code/renderers/server/template/cli/button.stories.json /code/core/src/theming/themes/light.ts /code/addons/interactions/src/components/InteractionsPanel.tsx /docs/_snippets/storybook-preview-extended-theme-variables.md /code/addons/themes/package.json /code/core/src/preview-api/Errors.stories.tsx /code/core/src/components/components/Modal/Modal.styled.tsx
Even stranger, the error ONLY happens when basing off of the dark theme.
...themes.dark
line 13 of preview.tsx
being set as light theme will not cause it.
Describe the bug
When using CSS vars in the docs container theme, everything works fine until you click 'Show Code' and an error is thrown, the page goes blank.
Reproduction link
https://stackblitz.com/edit/github-lyvshn-myigje?file=.storybook%2Fpreview.tsx
Reproduction steps
System
Additional context
No response