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

[Bug]: mergeLonghand should not merge an invalid property with a valid one #1454

Open
jathak opened this issue Nov 21, 2022 · 0 comments
Open

Comments

@jathak
Copy link

jathak commented Nov 21, 2022

Describe the bug

mergeLonghand currently merges properties even when one of them is invalid.

For example, code like:

a {
  margin-top: 10px;
  margin-left: 20px;
  margin-right: 30px;
  margin-bottom: invalid;
}

is minified to:

a{margin:10px 30px invalid 20px}

This changes the behavior of the code, as in the longhand form, only the invalid bottom margin is ignored by the browser. When the margins are combined, the combined property is now invalid, so the browser ignores all the margins.

Expected behaviour

Valid and invalid longhand properties should not be merged.

Steps to reproduce

Copy the example above into https://cssnano.co/playground/

Version

5.1.14

Preset

default

Environment

https://cssnano.co/playground/

Package details

Whatever the playground is using

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant