-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Semicolons being added after &
nesting rules postcss-nesting
#1150
Comments
Hi @AlbertMarashi, Thank you for reaching out about this. I can't seem to be able to replicate this issue in the playground We do have code to add semicolons to address this issue : #497 Is it possible that another plugin is causing this issue? |
@AlbertMarashi Have you had a chance to look into this? To us it seems that the bug lies elsewhere, so I am inclined to close this issue. |
@romainmenke Yes I've tried with only I am wondering if it's an issue to do with Svelte or Vite which I am using in my project import { sveltekit } from "@sveltejs/kit/vite"
import { defineConfig } from "vite"
import postcssNesting from "postcss-nesting"
export default defineConfig({
plugins: [sveltekit()],
css: {
postcss: {
plugins: [
// polyfill for nesting css (not widely supported yet)
postcssNesting(),
],
},
}
}) This doesn't work. I got no idea why it isn't working. Is it possible this could be a svelte or vite issue that is causing these rules to be merged by a Weirdly enough, when I don't use postcss-nesting it just works with svelte/vite which leads me to believe this is an interop issue, but unfortunately I lose browser support with that option |
https://github.com/AlbertMarashi/postcss-nesting-bug Here is a minimal reproducible example demonstrating the issue. Disable |
I've just opted to use |
This is not a bug in
e.g. I think that Svelte/Vite/... contains some plugin for CSS modules? You are obviously free to use any tool you want and whatever works for you is also the best tool ;) |
@AlbertMarashi I am a bit surprised to find that you are fully aware that CSS nesting is not supported in Svelte 😕 I am not sure why you would expect all this to work when you know that Svelte is working on it... sveltejs/svelte#8587 (comment) I've just spend considerable time trying to pinpoint what is going on and how to fix this issue. You could have given me the background that it simply isn't supported at all in Svelte... Please be respectful of other peoples time. |
I've filed the issue in the right place : sveltejs/svelte#9320 |
Bug description
Semicolons being added after
}
blocks using css nesting, leading to invalid CSS (semicolons not valid after}
block)Source CSS
Expected CSS
Actual CSS
Does it happen with
npx @csstools/csstools-cli <plugin-name> minimal-example.css
?Debug output
No response
Extra config
Using SvelteKit, Vite
What plugin are you experiencing this issue on?
PostCSS Nesting
Plugin version
^12.0.1
What OS are you experiencing this on?
Windows
Node Version
18.17
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: