8000 fix(postcss-convert-values): preserve percent sign in percentage values in at-rules with double quotes by aramikuto · Pull Request #1695 · cssnano/cssnano · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(postcss-convert-values): preserve percent sign in percentage values in at-rules with double quotes #1695

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

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ Thanks goes to these wonderful people:
- Xiaojun Zhou
- Seth Falco
- Seiya
- Aleksandr Kondrashov
2 changes: 1 addition & 1 deletion packages/postcss-convert-values/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function shouldKeepZeroUnit(decl, browsers) {
(node) =>
node.type === 'decl' &&
node.prop.toLowerCase() === 'syntax' &&
node.value === "'<percentage>'"
(node.value === "'<percentage>'" || node.value === '"<percentage>"')
)) ||
keepWhenZero.has(lowerCasedProp)
);
Expand Down
8 changes: 8 additions & 0 deletions packages/postcss-convert-values/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,14 @@ test(
)
);

test(
`should not strip the percentage from 0 in @property, for initial-value (syntax string in double quotes)`,
processCSS(
`@property --percent{syntax:"<percentage>";inherits:false;initial-value:0%;}`,
`@property --percent{syntax:"<percentage>";inherits:false;initial-value:0%;}`
)
);

test(
'should not strip the percentage from background-color',
passthroughCSS('background-color:color-mix(#000, #FFF 0%);')
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-minify-selectors/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ test(
processCSS(
'.item1, .item2, .item10, .item11{color:blue}',
'.item1,.item2,.item10,.item11{color:blue}',
{ sort: false },
{ sort: false }
)
);

Expand Down
Loading
0