storybook
storybook copied to clipboard
How do you share scss raw data with storybook?
How do you share scss with storybook? I have this question here https://stackoverflow.com/questions/66554897/how-do-you-share-scss-variables-with-javascript-in-nuxt. When building style guides, it seems nuxt users have 2 options for displaying scss variables.
- Duplicate the data in
.scssfile and.stories.js - Export the data from
.scssinto.stories.jsand dynamically show it in stories.
I tried the last option and even though my nuxt and storybook app is clearly taking advantage of my .scss styles, console.log returns empty when i try to import the styles. Is this a limitation of nuxt storybook? Is there any way to export my styles and classes from my .scss so i can display their names, information and uses in my stories?
As an example, i'm trying to do the following but it doesn't work https://css-tricks.com/getting-javascript-to-talk-to-css-and-sass/
@travis5491811 I've been using this solution with success: https://github.com/mdx-js/mdx/discussions/1952#discussioncomment-2266384
v4 of this module is no longer actively supported. Please try the newest version and open an new issue if the problem persists. Thank you for your understanding.