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

calc() causes incorrect re-ordering #385

Open
ThomasBrierley opened this issue Aug 2, 2018 · 0 comments
Open

calc() causes incorrect re-ordering #385

ThomasBrierley opened this issue Aug 2, 2018 · 0 comments

Comments

@ThomasBrierley
Copy link

ThomasBrierley commented Aug 2, 2018

CSSO appears to treat properties with calc() in the value as separate:

/* input */
div {
	width: 0;
	width: calc(100px);
}
/* output */
div {
	width: 0;
	width: calc(100px)
}

Unfortunately this causes more than missed optimisation opportunities:

/* input */
div, .foo {
	height: 0;
	width: 0;
}
div {
	height: 0;
	width: calc(100px);
}
/* output */
div {
	width: calc(100px)
}
.foo, div {
	height: 0;
	width: 0
}

(The width property above relies on order-based precedence and so the output is not equivalent.)

Environment

  • csso: v3.5.1
  • node: v8.11.3
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

2 participants