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

Restructuring causing merged style rules to be overwritten #830

Closed
xeonicca opened this issue Nov 3, 2016 · 2 comments
Closed

Restructuring causing merged style rules to be overwritten #830

xeonicca opened this issue Nov 3, 2016 · 2 comments
Labels

Comments

@xeonicca
Copy link

xeonicca commented Nov 3, 2016

Using [email protected] with the following rules:

.button--black {
  color: tomato;
  border-color: black;
  border-bottom-color: rgba(0, 0, 0, .2);
}

.button--blue {
  color: tomato;
  border-color: blue;
  border-bottom-color: rgba(0, 0, 0, .2);
}

will be minified into the following (unminified for readability):

.button--black, .button--blue {
  color: tomato;
  border-bottom-color: rgba(0, 0, 0, .2);
}

.button--black {
  border-color: #000;
}

.button--blue {
  border-color: #00f;
}

See the border bottom color will be overwritten because the merged rule is moved aboved border-color:#000. While turning off restructuring the code works as intended, but is this considered a bug on clean-css?

@xeonicca xeonicca changed the title Another restructuring issue causing style rules to be overwritten Restructuring causing merged style rules to be overwritten Nov 3, 2016
@jakubpawlowicz
Copy link
Collaborator

It's a bug indeed! Fix is coming.

jakubpawlowicz added a commit that referenced this issue Nov 16, 2016
Why:

* `border-X` and `border-<side>-X` were reorderable but obiously one
  cannot reorder them as that may change styling.
@jakubpawlowicz
Copy link
Collaborator

It's fixed in 3.4.21.

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

2 participants