css - Do Modernizr tests include browser-prefixed functionality? -
when testing functionality using modernizr, this:
if (modernizr.csstransforms) { $("#somediv").addclass('rotate'); }
does modernizr test return true earlier browsers support prefixed applications of rule, e.g. -mz-transform
, or test standard transform
? read documentation can't find reference check.
the goal apply transforms if browser supports them. give example.
supposing .rotate
class applies css 2d transform:
.rotate {transform:rotate(30deg)}
would class need include prefixed transforms, or modernizr not account them? there's no point adding in prefixed versions if modernizr isn't looking them.
.rotate {-moz-transform:rotate(30deg); -ms-transform:rotate(30deg); -o-transform:rotate(30deg); -webkit-transform:rotate(30deg); transform:rotate(30deg)}
modernizr tests against prefixed , prefixed versions. still need apply of css rules, however, since modernizr telling supports it, not specific rule works.
also, modernizr can add classes html
element, don't need
if (modernizr.csstransforms) { $("#somediv").addclass('rotate'); }
because instead of
.rotate .foo { transform:rotate(30deg) }
you can do
. csstransforms .foo { transform:rotate(30deg) }
Comments
Post a Comment