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

Don’t remove units in flex-basis value for (-ms-)flex shorthand #410

Closed
Didel opened this issue Nov 27, 2019 · 0 comments
Closed

Don’t remove units in flex-basis value for (-ms-)flex shorthand #410

Didel opened this issue Nov 27, 2019 · 0 comments

Comments

@Didel
Copy link

Didel commented Nov 27, 2019

According to issue #362 this was reported and fixed in an earlier version of CSSO. However, it looks like this is (partially) broken again.

The main work-around listed on Flexbugs (using 0% as a value, see https://github.com/philipwalton/flexbugs#4-flex-shorthand-declarations-with-unitless-flex-basis-values-are-ignored ) is actually not working with the current version (4.0.2). We should aim to fix this, as the work-around is probably well-known by now and because it is suggested it is the first thing developers will try to prevent the problem. A value of 0px is working as you'd expect (i.e. the unit is not removed). Also, the discussion in the original issue concludes:

Decision: we should remove unit removal for -ms-flex only

Which is not happening, the behaviour is the same for both flex and -ms-flex. In the example below, I actually expect that the output would be the same as the input, or at least for the -ms-flex uses.

Given the following input:

.flex {
    flex: 1 0 0;
}

.flex-pct {
    flex: 1 0 0%;
}

.flex-px {
    flex: 1 0 0px;
}

.ms-flex {
    -ms-flex: 1 0 0;
}

.ms-flex-pct {
    -ms-flex: 1 0 0%;
}

.ms-flex-px {
    -ms-flex: 1 0 0px;
}

I get the following output:

.flex {
    flex: 1 0 0
}

.flex-pct {
    flex: 1 0 0
}

.flex-px {
    flex: 1 0 0px
}

.ms-flex {
    -ms-flex: 1 0 0
}

.ms-flex-pct {
    -ms-flex: 1 0 0
}

.ms-flex-px {
    -ms-flex: 1 0 0px
}

Originally posted by @Didel in #362 (comment)

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