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

Comments

Projects
None yet
6 participants
@fjc0k

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;
@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented Apr 18, 2018

@fjc0k what version cssnano you use?

@fjc0k

This comment has been minimized.

fjc0k commented Apr 19, 2018

@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented Apr 19, 2018

@fjc0k can you try latest version rc?

@andyjansson

This comment has been minimized.

Collaborator

andyjansson commented Apr 19, 2018

npm i cssnano@next
@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented Apr 19, 2018

@fjc0k btw, what wrong with merge?

@prettyv

This comment has been minimized.

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

This comment has been minimized.

fjc0k commented Apr 20, 2018

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

@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented Apr 20, 2018

@fjc0k what result expected?

@fjc0k

This comment has been minimized.

fjc0k commented Apr 20, 2018

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

Sent with GitHawk

@An-Tu

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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