Skip to content

How to integrate UnoCSS with Nuxt 3.7.x + StoryBook 7.x? #24212

Answered by jdkcoder
jdkcoder asked this question in Help
Discussion options

You must be logged in to vote

I found the solution, first add module of unocss in nuxt.config.ts

...
 modules: [
   //...
    '@unocss/nuxt',
]

Then at preview.ts/preview.js just add import 'virtual:uno.css'

import type { Preview } from "@storybook/vue3";
import 'virtual:uno.css'

const preview: Preview = {
  parameters: {
    actions: { argTypesRegex: "^on[A-Z].*" },
    controls: {
      matchers: {
        color: /(background|color)$/i,
        date: /Date$/,
      },
    },
    docs: {
      toc: true,
    }
  },
};

export default preview;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jdkcoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant