-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Prod config produces invalid font-family values in minified CSS #4121
Comments
This sounds reasonable. |
I have also run into this problem with Ant Design for a production build. Would be great to get this merged. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
Is this a bug report?
Yes
Steps to Reproduce
font-family
declaration that includes a quoted, multiple-word font name that includes a generic CSS font family keyword as its first word (monospace
,cursive
,serif
, etc.). For example:npm run build
.Expected Behavior
The font declarations are intact.
Actual Behavior
body{font-family: Monospace Number}div{font-family: Primary Font,Cursive Font}
These are both invalid
font-family
value because of the keyword + lack of quotes. Confirmed they get ignored as invalid in Chrome 64, Firefox 58, and Safari 11.Related issues
cssnano/cssnano#434
cssnano/cssnano#439
Suggested fix
I suspect this comes up a fair amount because
"Monospace Number"
is used throughout some versions of the Ant Design stylesheet. It may also affect other weird name scenarios, like unicode characters in a font name or, the edgiest of edge cases, someone who used a custom font named, e.g., "serif" (I believe the spec allows this if it's quoted!).Given that it's unclear whether cssnano will change its default behavior, this could be fixed by updating
webpack.config.prod.js
to pass an option through to preserve the quotes:If this sounds reasonable I can send a PR.
The text was updated successfully, but these errors were encountered: