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

Probleme with CSS classes not showing or imported. #725

Open
FlorientPlouvin opened this issue Jul 18, 2024 · 4 comments
Open

Probleme with CSS classes not showing or imported. #725

FlorientPlouvin opened this issue Jul 18, 2024 · 4 comments
Labels
status: needs reproduction Needs a minimal reproduction type: bug Something isn't working

Comments

@FlorientPlouvin
Copy link

Hello everyone,

I have just installed the latest version of nuxt storybook on a project and everything works.

Attention the initialization command in the documentation is always : npx storybook-nuxt init

And I've noticed two problems, the first is that none of my classes are imported (either custom classes or tailwind classes).

I've also noticed that I get an error when I don't explicitly import ‘computed’ or similar into my component.

I suppose the two problems are linked, but I don't want to get ahead of myself.

@blowsie
Copy link
Contributor

blowsie commented Jul 31, 2024

Regarding npx storybook-nuxt init this may be related?
#721

For the other items, I have not encountered those, perhaps a reproduction may help others to help you.

@tobiasdiez
Copy link
Collaborator

We have various tests / examples that show that css/tailwind are working in principle. Could you please provide a minimal example (in the best case as a PR adding a test case in the "showcase" example? Thanks!

@tobiasdiez tobiasdiez added type: bug Something isn't working status: needs reproduction Needs a minimal reproduction labels Aug 3, 2024
@prodoxx
Copy link

prodoxx commented Aug 10, 2024

I also have this problem where tailwind isn't being imported. I import it manually but it only shows up when I view something with the same class on my non-storybook app as if it's being fetched in one of the build folders and it won't show if it's not in a build folder maybe. That's my guess. This is my preview.ts file right now:

import "tailwindcss/tailwind.css";
import type { Preview } from "@storybook/vue3";
import "./style.css";
import "../assets/css/tailwind.css";
import "../assets/css/main.css";

const preview: Preview = {
    parameters: {
        actions: { argTypesRegex: "^on[A-Z].*" },
        controls: {
            matchers: {
                color: /(background|color)$/i,
                date: /Date$/,
            },
        },
        layout: "centered",
        options: {
            storySort: {
                order: ["Styles", "Components"],
            },
        },
        globalTypes: {
            theme: {
                name: "Toggle theme",
                description: "Global theme for components",
                defaultValue: "light",
            },
        },
    },
};

export default preview;
image

I guess to reproduce would be to add a custom class like a color for example, don't add it to the main app, add it in storybook and then try to view it.

By the way, I'm using a tailwind.config.ts file and not the default that comes with the plugin. This it with a custom tailwind.config.ts file

@tobiasdiez
Copy link
Collaborator

@prodoxx @FlorientPlouvin could you please provide a minimal reproduction based on the tailwind example in the repo? (in the best case as a PR, then I can directly continue working on it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction Needs a minimal reproduction type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants