eduardoboucas / include-media

📐 Simple, elegant and maintainable media queries in Sass
https://eduardoboucas.github.io/include-media/
MIT License
2.57k stars 191 forks source link

Deprecation Warning: Sass's Behavior for Declarations After Nested Rules #232

Open lhoucinecherif opened 3 weeks ago

lhoucinecherif commented 3 weeks ago

I am encountering a deprecation warning when using 'eduardoboucas/include-media' in a Nuxt3 project. The warning message is as follows:

Deprecation Warning: Sass's behavior for declarations that appear after nested rules is deprecated.Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls
jackmcpickle commented 3 weeks ago

@lhoucinecherif thanks for the heads up. Sounds like a small change. Will check out later this week and see where we get. Otherwise feel free to put a PR up. 😉

lhoucinecherif commented 1 week ago

I followed the guidance from this issue and managed to silence the warning in my Nuxt app by updating the Nuxt configuration. Here's the relevant part of my nuxt.config.js:

vite:  {
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: '@import "@/assets/scss/_variables.scss";',
        api: 'modern',
        silenceDeprecations: ['mixed-decls'],
      },
    },
  },
}