-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
When processing Nested CSS the ownSemicolon
flag in the PostCSS AST is set to true for rules with nodes.
#9320
Comments
4 tasks
Thanks @romainmenke |
5 tasks
This was referenced Nov 20, 2023
Small PostCSS plugin to fix the problem as a temporary solution: module.exports = {
postcssPlugin: 'svelte-nesting-css-fixer',
Rule(rule) {
delete rule.raws.ownSemicolon
}
} |
What a perfect timing! I can live up with this until it gets merged. Thanks! // postcss.config.cjs
const nested = require('postcss-nested');
const svelteNestingCssFixer = {
postcssPlugin: 'svelte-nesting-css-fixer',
Rule(rule) {
delete rule.raws.ownSemicolon
}
};
const config = {
plugins: [
nested,
svelteNestingCssFixer,
],
};
module.exports = config; |
AlbertMarashi
added a commit
to AlbertMarashi/svelte
that referenced
this issue
Nov 27, 2023
Excluding CSS type element selectors closes sveltejs#9320 closes sveltejs#8587
AlbertMarashi
added a commit
to AlbertMarashi/svelte
that referenced
this issue
Nov 27, 2023
closes sveltejs#8587
Thanks! How can I use when plugins is an object? // postcss.config.js
export default {
plugins: {
'tailwindcss/nesting': 'postcss-nesting',
tailwindcss: {},
}
} |
Svelte 5 supports CSS nesting, therefore closing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
re-post of : csstools/postcss-plugins#1150
I am submitting this bug report after it was filed in
postcss-nesting
by @AlbertMarashi. I am a maintainer ofpostcss-nesting
, I am not the author of the reproduction.I do not use Svelte, Vite, CSS modules, ... so I don't really know much about the repro or what the current best practices are in Svelte for CSS.
What I did :
@csstools/postcss-debug-logger
npm run build
This logs :
For a regular rule
"ownSemicolon":";"
should not be present.This is not added by
postcss-nesting
.Because I don't know anything about Svelte I am also unsure which parts might be responsible.
I know that currently there isn't really support for CSS Nesting in Svelte.
So maybe good to test for this case when support is rolled out.
#8587
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
Reproduction
https://github.com/AlbertMarashi/postcss-nesting-bug
Logs
System Info
Severity
not even an annoyance
The text was updated successfully, but these errors were encountered: