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

Improve border output #590

Closed
everdimension opened this issue Aug 23, 2018 · 7 comments
Closed

Improve border output #590

everdimension opened this issue Aug 23, 2018 · 7 comments
Assignees

Comments

@everdimension
Copy link

everdimension commented Aug 23, 2018

Hi!

Thanks for creating this package.

I stumbled upon an issue, though. The css code that was minified with CSSNANO gave me an incorrect result. Here's a demo:
https://codepen.io/everdimension/pen/XPbGQO?editors=1100

image

@alexander-akait
Copy link
Member

Looks problem with border

@andyjansson
Copy link
Contributor

I don't believe this issue persists in current master.

@alexander-akait
Copy link
Member

@andyjansson maybe we can tests?

@andyjansson
Copy link
Contributor

The following input..

border-style: solid;
border-width: 4px 0 5px 8px;
border-color: transparent transparent transparent var(--closed-color);

...produces the following output:

border-left: 8px solid var(--closed-color);
border-bottom: 5px solid transparent;
border-right: 0 solid transparent;
border-top: 4px solid transparent;

It's not optimal, but it's at least technically correct. I think we should keep the issue open as something to work on as an enhancement.

@andyjansson andyjansson changed the title Incorrect (non-equivalent) css generated Improve border output Aug 23, 2018
@eablokker
Copy link

I'm also having issues with border output

This gets transformed

border-width: 2px;
border-style: solid;
border-top: 0;
border-left: 0;

Into this

border-left: 0;
border-style: solid;
border-top: 0;
border-width: 2px;

The border-style: solid; negates the border-left: 0; rendering a broken result.

Why oh why is cssnano rearranging my properties and putting them in alphabetical order? Even if I turn off the cssDeclarationSorter option, it still sorts them this way.

@andyjansson
Copy link
Contributor

andyjansson commented Aug 25, 2018

@eablokker your issue with mergeLonghand should already been fixed. The only straggling issue in your case would be with cssDeclarationSorter.

@alexander-akait
Copy link
Member

Close in favor #535

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

4 participants