Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tailwind.config.ts #667

Open
4 tasks done
tobyperplex opened this issue Feb 1, 2024 · 1 comment
Open
4 tasks done

Support tailwind.config.ts #667

tobyperplex opened this issue Feb 1, 2024 · 1 comment
Labels
enhancement: to triage New feature of request pending review by team member

Comments

@tobyperplex
Copy link

Clear and concise description of the problem

Histoire will automatically detect your Tailwind CSS configuration and generate design system stories for you. But not if you make your tailwind.config.js with module.exports a tailwind.config.ts with export default.

Suggested solution

Support both tailwind.config.js with module.exports and tailwind.config.ts with export default.

Alternative

No response

Additional context

No response

Validations

@tobyperplex tobyperplex added the enhancement: to triage New feature of request pending review by team member label Feb 1, 2024
@JackNeto
Copy link

JackNeto commented May 7, 2024

I have the same problem, I'm trying to add histoire to an existing svelte project that uses tailwind with some theming and plugins and and these are not bing picked up. Instead histoire displays some other tailwind configuration in the ui.

Here's my setup:

histoire.config.js

import { defineConfig } from 'histoire';
import { HstSvelte } from '@histoire/plugin-svelte';

export default defineConfig({
	plugins: [HstSvelte()],
	setupFile: './histoire-setup.ts',
});

histoire-setup.ts

import './src/app.css';

app.css

@tailwind base;
@tailwind components;
@tailwind utilities;

tailwind.config.js (this file is ignored)

/** @type {import('tailwindcss').Config} */
export default {
	content: [
		'./src/**/*.{html,js,svelte,ts}',
		'./node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}',
		'./node_modules/flowbite-svelte-icons/**/*.{html,js,svelte,ts}'
	],
	plugins: [require('flowbite/plugin')],
	darkMode: 'class',
	theme: {
		extend: {
			colors: {
                               .... a bunch of colors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement: to triage New feature of request pending review by team member
Projects
None yet
Development

No branches or pull requests

2 participants