soney / constraintjs

Constraint library for JavaScript

Home Page:cjs.from.so/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto add('px') on bindCSS setter for integers ?

QuentinRoy opened this issue · comments

When a given css property is a number, jquery automatically add the 'px' suffix.
Exceptions are (from jquery source code):

{
        "columnCount": true,
        "fillOpacity": true,
        "flexGrow": true,
        "flexShrink": true,
        "fontWeight": true,
        "lineHeight": true,
        "opacity": true,
        "order": true,
        "orphans": true,
        "widows": true,
        "zIndex": true,
        "zoom": true
    }

I kind of like this behavior... And I guess if jquery does it, it is safe. I think cjs should do the same.

Another arguments in favor of this functionality:
The behavior of cjs regarding this depends of the html doctype balise on top of the page it is included... Yeah I just lost 2 hours trying to understand why the exact same code didn't work anymore in a (almost) similar condition.