Skip to content
Discussion options

You must be logged in to vote

Hi, I had same (or I guess it´s similar) issue.
I solved it with @tailwindcss/cli. Maybe exists some better solution, but this one works for me.

# package.json
{
  "scripts": {
    "storybook": "yarn tailwind:watch | yarn storybook:dev",
    "storybook:dev": "storybook dev -p 6006",
    "storybook:build": "yarn tailwind:build && storybook build",
    "tailwind:build": "yarn tailwindcss --cwd ./our_base_path -i ./path_to_input_file/styles.css -o ./path_to_output_file/styles.css",
    "tailwind:watch": "yarn tailwind:build --watch",
  },

  "devDependencies": {
    "@tailwindcss/cli": "^4.0.6"
  }
}
// preview.tsx
import "./path_to_output_file/styles.css"

Replies: 4 comments 13 replies

Comment options

You must be logged in to vote
1 reply
@mapten
Comment options

Comment options

You must be logged in to vote
3 replies
@serchserch
Comment options

@tobiaszwinger
Comment options

@yacafx
Comment options

Answer selected by mapten
Comment options

You must be logged in to vote
8 replies
@unional
Comment options

@hmt
Comment options

@unional
Comment options

@bruno-pmakers
Comment options

@giacomoalonzi
Comment options

Comment options

You must be logged in to vote
1 reply
@yikl1004
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet