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

css-minifier: An [unsupported-css-nesting] warning is displayed for @page margin-at-rules when the target doesn't support CSS nesting #3197

Closed
PHoltom-Sequiter opened this issue Jun 26, 2023 · 1 comment

Comments

@PHoltom-Sequiter
Copy link

PHoltom-Sequiter commented Jun 26, 2023

With a css file containing a margin-at-rule, like so:

@page {
	@top-left {
		content: "Anything";
	}
}

Attempting to minify with a target that doesn't support CSS nesting, for example .\node_modules\.bin\esbuild .\test.css --minify --target=chrome87

Results in a warning

▲ [WARNING] CSS nesting syntax is not supported in the configured target environment ("chrome87") [unsupported-css-nesting]

    test.css:2:1:
      2 │   @top-left {
        ╵   ~~~~~~~~~

Support for this particular nesting predates CSS nesting by quite a bit: MDN Docs

The output generated appears to be fine, in the above example the result is @page{@top-left{content:"Anything"}} but is there anything that can be done about the warning?

@PHoltom-Sequiter PHoltom-Sequiter changed the title css-minfier: An [unsupported-css-nesting] warning is displayed for @page margin-at-rules when the target doesn't support CSS nesting css-minifier: An [unsupported-css-nesting] warning is displayed for @page margin-at-rules when the target doesn't support CSS nesting Jun 26, 2023
@evanw
Copy link
Owner

evanw commented Jun 26, 2023

I'll look into it. In the meantime, you can disable the warning with --log-override:unsupported-css-nesting=silent.

@evanw evanw closed this as completed in 8a15942 Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants