Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #207 from janel-nicolas/patch-1

Adding support for floating values for viewport plugin
  • Loading branch information...
commit 7d922a1343e865d3f21d8654a7212656841e009b 2 parents 91790e8 + 44d8e17
@LeaVerou authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 plugins/prefixfree.viewport-units.js
View
4 plugins/prefixfree.viewport-units.js
@@ -25,7 +25,7 @@ if(!units.length) {
StyleFix.register(function(css) {
var w = innerWidth, h = innerHeight;
- return css.replace(RegExp('\\b(\\d+)(' + units.join('|') + ')\\b', 'gi'), function($0, num, unit) {
+ return css.replace(RegExp('\\b(\\d+\\.?\\d*)(' + units.join('|') + ')\\b', 'gi'), function($0, num, unit) {
switch (unit) {
case 'vw':
return num * w / 100 + 'px';
@@ -39,4 +39,4 @@ StyleFix.register(function(css) {
});
});
-})();
+})();
Please sign in to comment.
Something went wrong with that request. Please try again.