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

mergeLonghand is NOT SAFE! here is a case #461

Closed
fjc0k opened this issue Apr 17, 2018 · 12 comments · Fixed by #502
Closed

mergeLonghand is NOT SAFE! here is a case #461

fjc0k opened this issue Apr 17, 2018 · 12 comments · Fixed by #502

Comments

@fjc0k
Copy link

fjc0k commented Apr 17, 2018

raw css (generated by stylus mixin):

border: 0 solid rgba(0, 0, 0, 0.2);
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;

minified css with mergeLonghand = true:

border: 0 solid rgba(0, 0, 0, 0.2);
border: 1px;
@alexander-akait
Copy link
Member

@fjc0k what version cssnano you use?

@fjc0k
Copy link
Author

fjc0k commented Apr 19, 2018

@evilebottnawi 3.10.0

@alexander-akait
Copy link
Member

@fjc0k can you try latest version rc?

@andyjansson
Copy link
Contributor

npm i cssnano@next

@alexander-akait
Copy link
Member

@fjc0k btw, what wrong with merge?

@prettyv
Copy link

prettyv commented Apr 19, 2018

I think what @fjc0k means is that the merge result should be

border: 0 solid rgba(0, 0, 0, 0.2);
border-width: 1px;

As is the merge result overwrites the whole border definition and loses width and color.

@fjc0k
Copy link
Author

fjc0k commented Apr 20, 2018

@evilebottnawi sorry, now i can’t test it. The worng is as @prettyv said.

@alexander-akait
Copy link
Member

@fjc0k what result expected?

@fjc0k
Copy link
Author

fjc0k commented Apr 20, 2018

@evilebottnawi border: 0 solid rgba(0, 0, 0, 0.2); border-width: 1px;

Sent with GitHawk

@An-Tu
Copy link
Contributor

An-Tu commented Jun 3, 2018

@fjc0k Are you sure that

border: 0 solid rgba(0, 0, 0, 0.2);
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;

must be

border: 0 solid rgba(0, 0, 0, 0.2);
border-width: 1px;

?

Because I tested it locally, and i got this

border: 1px solid rgba(0, 0, 0, 0.2);

@fjc0k
Copy link
Author

fjc0k commented Jun 4, 2018

@An-Tu Oh, I think

border: 0 solid rgba(0, 0, 0, 0.2);
border-width: 1px;

is equal to

border: 1px solid rgba(0, 0, 0, 0.2);

What I want to say is that the result is wrong, not the form.

@sairus2k
Copy link

sairus2k commented Jun 5, 2018

Already fixed in 4.0.0-rc.0. I think this issue might be closed.

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

Successfully merging a pull request may close this issue.

6 participants