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

disappearing border width when using CSS variables #806

Closed
jlowcs opened this issue Aug 25, 2016 · 3 comments
Closed

disappearing border width when using CSS variables #806

jlowcs opened this issue Aug 25, 2016 · 3 comments
Labels
Milestone

Comments

@jlowcs
Copy link

jlowcs commented Aug 25, 2016

Input:

.foobar1a {
    border: solid red 1px;
}
.foobar1b {
    border: 1px green solid;
}
.foobar2a {
    border: solid var(--test1) 1px;
}
.foobar2b {
    border: 1px var(--test1) solid;
}
.foobar3 {
    border: 1px solid var(--test1);
}

Output (with cleancss testfile.css -b):

.foobar1a{border:1px solid red}
.foobar1b{border:1px solid green}
.foobar2a{border:var(--test1) solid}
.foobar2b{border:1px var(--test1) solid}
.foobar3{border:1px solid var(--test1)}

On .foobar2a, the border width has disappeared. Probably a parsing issue.

Work around is to put the variable at the end (see .foobar3).

@jakubpawlowicz
Copy link
Collaborator

It's the way break-up.js tries to determine border components, which is tricky when it comes to variables. I wonder if we should try hard to match or just mark such properties as unoptimizable.

@jakubpawlowicz jakubpawlowicz added this to the 4.0 milestone Jan 4, 2017
@jakubpawlowicz
Copy link
Collaborator

Let's skip optimizing such properties for now. In theory one could optimize cases where all 3 border values are given and one of them is a variable, but it's an additional complexity probably not worth the hassle.

@jakubpawlowicz
Copy link
Collaborator

Due in 4.0.

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