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] : Merging border-top and border-color gives unexpected output #1100

Closed
Siilwyn opened this issue May 13, 2021 · 3 comments
Closed

[Bug] : Merging border-top and border-color gives unexpected output #1100

Siilwyn opened this issue May 13, 2021 · 3 comments
Labels

Comments

@Siilwyn
Copy link
Contributor

Siilwyn commented May 13, 2021

Describe the bug
Given a{border-top:1px solid;border-color:purple} results in a{border-color:currentcolor purple purple;border-top:1px solid purple}.

To Reproduce
Run a test like this:

test(
  'keep order of border properties, short- and longhand, right to left',
  passthroughCSS('a{border-top:1px solid;border-color:purple}')
);

Expected behavior
Expected output would I think be the same as the input so: border-top:1px solid;border-color:purple.

Environment
Node.js 14, cssnano on master 4d7fe367.

Additional context
See #1071

@ludofischer
Copy link
Collaborator

ludofischer commented May 13, 2021

I think this might be a duplicate of #1044
merge-longhand first splits every shorthand into the single properties, then tries to merge them back, but sometimes it merges back into a form that's longer than the original.

In this case, it goes from border-top: 1px solid;border-color: purple

border-top-width: 1px;
border-top-style: solid;
border-top-color: currentcolor;
border-top-color: purple;
border-left-color: purple;
/* every border-*-color: purple 

Then tries to merge it back and finds that strange result (notice that the new rule seems in fact reasonably equivalent to the original, so at least it's not completely broken)

@alexander-akait
Copy link
Member

We really need rewrite our merge on more stable solution, right now it is so complex

@Siilwyn
Copy link
Contributor Author

Siilwyn commented May 13, 2021

Yes, let's close this as a duplicate of #1044.

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

No branches or pull requests

3 participants