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

Optimization of adjacent (?) blocks and multiple properties. #244

Closed
ne0-cz opened this issue Oct 19, 2015 · 3 comments
Closed

Optimization of adjacent (?) blocks and multiple properties. #244

ne0-cz opened this issue Oct 19, 2015 · 3 comments

Comments

@ne0-cz
Copy link

ne0-cz commented Oct 19, 2015

I think this is bug.

I have a sample CSS code:

.transfers.is-toggle-visible {
  display: block; }

.transfer {
  display: inline-block;
  width: 120px;
  width: 134px;
  width: 140px;
  display: block;
  width: auto; }

This is what I would expect as CSSO output (using whitespaces for clarity):

.transfers.is-toggle-visible {
  display: block; }

.transfer {
  display: block;
  width: auto; }

And this is what I get (added whitespaces for clarity):

.transfers.is-toggle-visible,
.transfer {
  display:block }

.transfer {
  display:inline-block;
  width:140px;
  width:auto}

The original output of CSSO without the added whitespaces:

.transfers.is-toggle-visible,.transfer{display:block}.transfer{display:inline-block;width:140px;width:auto}

(Sorry about the title of the issue - I'm not sure how to name it correctly.)

@lahmatiy
Copy link
Member

Yep, there are few bugs actually.

  1. display is never merging; it was hardcored, but I fixed it yesterday (see issue Remove duplicate properties #167)
  2. width is not merging, because of regression in 1.4, due to emergency solution for wrong value merge that has different browser support. It's not a bug, but compression could be better. I reworking compression algorithms now and declaration merging as well. So it's would be fixed in next release.

Current dev version output is (formatted for readability)

.transfers.is-toggle-visible, .transfer {
  display: block
}
.transfer {
  width: 140px;
  width: auto
}

Correct output should be

.transfers.is-toggle-visible, .transfer {
  display: block
}
.transfer {
  width: auto
}

@ne0-cz
Copy link
Author

ne0-cz commented Oct 19, 2015

Great news, looking forward to the next release then. Thanks!

@lahmatiy
Copy link
Member

v1.4.1 is out with fix for this issue

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

No branches or pull requests

2 participants