Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

CSS: Don't add 'px' to '-ms-flex-order' #1528

Closed
wants to merge 1 commit into from

5 participants

@silverwind silverwind referenced this pull request from a commit in silverwind/droppy
@silverwind silverwind Fix #73 - IE10 flex order sorting 2a2ab5c
@gibson042
Collaborator

I don't want to start adding vendor-prefixed properties to that collection. Why not just define a msFlexOrder cssHook?

@mzgol
Collaborator

@gibson042 I'd imagine using cssHooks is not easy so most people won't realize how to do it. Flex becomes popular so it might be an issue in the future.

I'd like to know how many of those properties there are. If -ms-flex-order is really all we need, I'm for it. If there are significantly more such properties, then -1 from me.

@scottgonzalez

Even if cssHooks is too complicated for most users, cssNumber certainly isn't. So even if we don't include this, it's very simple for users to add in their own code.

@silverwind

Aside from order, there are these properties which expect numerical values:

  • -ms-flex-negative
  • -ms-flex-positive

But I'd assume that most people wouldn't actually use these directly, but use the shorthand -ms-flex instead. At least I always do.

@gibson042
Collaborator

Even if cssHooks is too complicated for most users, cssNumber certainly isn't. So even if we don't include this, it's very simple for users to add in their own code.

cssNumber is not part of the public API, but this issue may be just the incentive we need to change that.

@dmethvin
Owner

Didn't a lot of the properties change from the IE10 draft standard implementation to the one that's currently on track for a standard? I don't think we should be adding properties that are dead-end ones. To me .css() is generally bad practice anyway and this should be done via classes unless there is some extenuating circumstance.

There's already a ticket to document this: jquery/api.jquery.com#164

@silverwind

Oh, and I almost forgot, but there's also unprefixed versions which probably would need this treatment, I think these should be all:

  • -ms-flex-negative
  • -ms-flex-positive
  • flex-shrink
  • flex-grow
@silverwind

Didn't a lot of the properties change from the IE10 draft standard implementation to the one that's currently on track for a standard?

Yep, most of what IE10 uses got renamed in the current version of the standard.

To me .css() is generally bad practice anyway and this should be done via classes unless there is some extenuating circumstance.

I totally agree that .css() is bad, but to dynamically sort a list using flexbox ordering, one has to resort to it. For the other properties above thought, I don't really see why they shouldn't be set in the stylesheet directly.

@mzgol
Collaborator

We're definitely missing some flexbox-related properties in that list, even unprefixed ones. We should fix that.

@dmethvin
Owner

That would make sense, and quite a few browsers already are shipping it unprefixed: http://caniuse.com/#feat=flexbox

@silverwind

So the question is, which ones should I add on the pull request?

This is the full list:

  • flex-shrink
  • flex-grow
  • -ms-flex-order
  • -ms-flex-negative
  • -ms-flex-positive

The first three are the minimum, I'd say. flex-shrink and flex-grow obviously because they're standardized, -ms-flex-order for the necessity of list-sorting. -ms-flex-negative and -ms-flex-positive really don't seem of any use to me.

@mzgol
Collaborator

I wouldn't us cherry-pick which prefixed versions to support and which not, it will be confusing to the user; way more than us just not supporting prefixed versions in this way at all.

The problem here is the user doing $div.css('-ms-flex-order', 2) will not expect anything can break from that. OTH, if we start adding prefixed properties, we're in for a potentially big list.

I wish we didn't add px automatically at all but changing that would be a compatibility break, potentially huge.

@mzgol
Collaborator

If we can do it via exposing cssNumber instead of forcing users to resort to cssHooks, that seems more user-friendly.

@dmethvin dmethvin closed this
@mzgol
Collaborator

@dmethvin we still need to add standard flex properties to the list and I was under the impression OP wanted to do it. Shall we reopen?

@dmethvin
Owner

Oh that's cool, but a fresh PR probably makes more sense because at this point it's not related. @silverwind we'd love that PR for the standard properties when you get a chance.

@mzgol
Collaborator

@dmethvin Yeah, that makes sense.

@silverwind

@dmethvin Alright, I'll provide a new PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 4, 2014
  1. @silverwind
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  src/css.js
View
1  src/css.js
@@ -224,6 +224,7 @@ jQuery.extend({
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
+ "msFlexOrder": true,
"opacity": true,
"order": true,
"orphans": true,
Something went wrong with that request. Please try again.