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 warning on "star property hack" #1638

Closed
silverwind opened this issue Sep 28, 2021 · 1 comment
Closed

CSS minifier warning on "star property hack" #1638

silverwind opened this issue Sep 28, 2021 · 1 comment

Comments

@silverwind
Copy link

silverwind commented Sep 28, 2021

While minifying a dependency, I came around this warning:

warnings when minifying css:
 > <stdin>:191:30201: warning: Expected identifier but found "*"
    191 │ ...fter{clear:both}.swagger-ui .cf{*zoom:1}.swagger-ui .cl{clear:le...

Strictly speaking, a * in a CSS property name is invalid, but I wonder whether an exception should be made in esbuild to not warn on it because it has active usage in some legacy code.

Refs:

@evanw
Copy link
Owner

evanw commented Oct 15, 2021

I think I'd like to keep this warning. IE aside, this is invalid CSS and is a syntax error. And since esbuild esbuild emits this as a warning, it also doesn't prevent you from using esbuild on this code. You can always use --log-level=error if you don't want to see warnings. There are likely many syntax errors that IE allows so it seems strange to special-case this one. An alternative could be to turn off all esbuild warnings about CSS syntax errors, but I don't think that makes sense since IE 7 is ancient and unsupported and irrelevant. I think the correct fix in this case is to remove the invalid CSS, which is what was done in this case. Closing.

@evanw evanw closed this as completed Oct 15, 2021
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