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

[Bug]: Nested CSS warning after updating to latest release #27161

Open
endigo9740 opened this issue May 15, 2024 · 4 comments
Open

[Bug]: Nested CSS warning after updating to latest release #27161

endigo9740 opened this issue May 15, 2024 · 4 comments

Comments

@endigo9740
Copy link

endigo9740 commented May 15, 2024

Describe the bug

I'm receiving the following warnings after updating to the @latest release:

Screenshot 2024-05-15 at 9 35 14 AM

These styles are not present within my project, and we go out of our way to avoid using nested CSS.

Screenshot 2024-05-15 at 9 57 43 AM

To Reproduce

Migrate to the @latest release as of today.

System

Storybook Environment Info:

  System:
    OS: macOS 14.4
    CPU: (8) arm64 Apple M1
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.1.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.2.0 - /opt/homebrew/bin/npm
    pnpm: 8.10.2 - /opt/homebrew/bin/pnpm <----- active
  Browsers:
    Chrome: 124.0.6367.203
    Safari: 17.4
  npmPackages:
    @storybook/addon-essentials: ^8.1.1 => 8.1.1 
    @storybook/addon-interactions: ^8.1.1 => 8.1.1 
    @storybook/addon-links: ^8.1.1 => 8.1.1 
    @storybook/addon-svelte-csf: ^4.1.2 => 4.1.2 
    @storybook/addon-themes: ^8.1.1 => 8.1.1 
    @storybook/blocks: ^8.1.1 => 8.1.1 
    @storybook/preview-api: ^8.1.1 => 8.1.1 
    @storybook/svelte: ^8.1.1 => 8.1.1 
    @storybook/sveltekit: ^8.1.1 => 8.1.1 
    @storybook/test: ^8.1.1 => 8.1.1 
    eslint-plugin-storybook: ^0.8.0 => 0.8.0 
    storybook: ^8.1.1 => 8.1.1 
    storybook-dark-mode: ^4.0.1 => 4.0.1

Additional context

The warning mentions arranging the order of Tailwind plugins. We do use Tailwind, but we do not use the Tailwind Nested CSS plugin. Again, we go out of our way to avoid nesting.

@onishi-kohei
Copy link

@endigo9740
In a Nuxt project, I also encountered the same issue. I was able to suppress the warning by introducing tailwindcss/nesting on the project side.

import tailwindcssNesting from 'tailwindcss/nesting'

const config = {
  vite: {
    css: {
      postcss: {
        plugins: [tailwindcssNesting]
      }
    }
  }
}

export default config

@endigo9740
Copy link
Author

@onishi-kohei good to know. Unfortunately we would rather avoid the extra dependency.

@onishi-kohei
Copy link

@endigo9740
I think so too.

@YannDuv
Copy link

YannDuv commented May 27, 2024

Same warning, but with a Lit project. We are using tailwindCSS but no nesting CSS.

2:16:07 PM [vite] ✨ optimized dependencies changed. reloading
[vite:css] Nested CSS was detected, but CSS nesting has not been configured correctly.
Please enable a CSS nesting plugin *before* Tailwind in your configuration.
See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting
125|      box-sizing: border-box;
126|  
127|      & ol {
   |      ^^^^^^
128|        padding-left: 18px;
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^
129|        margin: 0;
   |  ^^^^^^^^^^^^^^^^
130|      }
   |  ^^^^^

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

No branches or pull requests

4 participants