Comparing version 0.2.0 to 1.0.0
@@ -91,12 +91,13 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
function jssPx(rule) { | ||
var style = rule.style; | ||
function jssPx() { | ||
return function (rule) { | ||
var style = rule.style; | ||
if (!style) return; | ||
for (var prop in style) { | ||
if (!cssNumber[prop] && typeof style[prop] == 'number') { | ||
style[prop] += 'px'; | ||
if (!style) return; | ||
for (var prop in style) { | ||
if (!cssNumber[prop] && typeof style[prop] == 'number') { | ||
style[prop] += 'px'; | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
@@ -103,0 +104,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.jssPx=o():e.jssPx=o()}(this,function(){return function(e){function o(r){if(t[r])return t[r].exports;var n=t[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}var t={};return o.m=e,o.c=t,o.p="",o(0)}([function(e,o){"use strict";function t(e){var o=e.style;if(o)for(var t in o)r[t]||"number"!=typeof o[t]||(o[t]+="px")}o.__esModule=!0,o["default"]=t;var r={"animation-iteration-count":!0,"box-ordinal-group":!0,"column-count":!0,"fill-opacity":!0,flex:!0,"flex-grow":!0,"flex-order":!0,"flex-shrink":!0,"font-weight":!0,"line-height":!0,opacity:!0,order:!0,orphans:!0,"stop-opacity":!0,"tab-size":1,widows:!0,"z-index":!0,zoom:!0};e.exports=o["default"]}])}); | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.jssPx=o():e.jssPx=o()}(this,function(){return function(e){function o(n){if(t[n])return t[n].exports;var r=t[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}var t={};return o.m=e,o.c=t,o.p="",o(0)}([function(e,o){"use strict";function t(){return function(e){var o=e.style;if(o)for(var t in o)n[t]||"number"!=typeof o[t]||(o[t]+="px")}}o.__esModule=!0,o["default"]=t;var n={"animation-iteration-count":!0,"box-ordinal-group":!0,"column-count":!0,"fill-opacity":!0,flex:!0,"flex-grow":!0,"flex-order":!0,"flex-shrink":!0,"font-weight":!0,"line-height":!0,opacity:!0,order:!0,orphans:!0,"stop-opacity":!0,"tab-size":1,widows:!0,"z-index":!0,zoom:!0};e.exports=o["default"]}])}); |
@@ -0,1 +1,6 @@ | ||
## 1.0.0 / 2015-10-19 | ||
- support jss 3.0 | ||
- now plugin needs to be called like a middleware | ||
## 0.2.0 / 2015-09-21 | ||
@@ -2,0 +7,0 @@ |
@@ -35,14 +35,15 @@ // Don't automatically add 'px' to these possibly-unitless properties. | ||
function jssPx(rule) { | ||
var style = rule.style; | ||
function jssPx() { | ||
return function (rule) { | ||
var style = rule.style; | ||
if (!style) return; | ||
for (var prop in style) { | ||
if (!cssNumber[prop] && typeof style[prop] == 'number') { | ||
style[prop] += 'px'; | ||
if (!style) return; | ||
for (var prop in style) { | ||
if (!cssNumber[prop] && typeof style[prop] == 'number') { | ||
style[prop] += 'px'; | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
module.exports = exports['default']; |
{ | ||
"name": "jss-px", | ||
"description": "JSS plugin that adds default px unit to numeric values where needed", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"author": { | ||
@@ -41,3 +41,3 @@ "name": "Oleg Slobodskoi", | ||
"eslint-plugin-react": "^2.7.0", | ||
"jss": "^2.3.4", | ||
"jss": ">=3.0.0 < 4.0.0", | ||
"opener": "^1.4.1", | ||
@@ -49,4 +49,4 @@ "qunitjs": "1.15.0", | ||
"peerDependencies": { | ||
"jss": "^2.3.4" | ||
"jss": ">=3.0.0 < 4.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
![JSS logo](http://avatars1.githubusercontent.com/u/9503099?v=3&s=60) | ||
![JSS logo](https://avatars1.githubusercontent.com/u/9503099?v=3&s=60) | ||
@@ -19,5 +19,5 @@ ## JSS plugin that adds default px unit to numeric values where needed | ||
jss.use(px) | ||
jss.use(px()) | ||
const styleSheet = jss.createStyleSheet({ | ||
let sheet = jss.createStyleSheet({ | ||
container: { | ||
@@ -32,3 +32,3 @@ 'font-size': 20, | ||
```javascript | ||
console.log(styleSheet.toString()) | ||
console.log(sheet.toString()) | ||
``` | ||
@@ -44,3 +44,3 @@ ```css | ||
```javascript | ||
console.log(styleSheet.classes) | ||
console.log(sheet.classes) | ||
``` | ||
@@ -51,3 +51,2 @@ ```javascript | ||
## Run tests | ||
@@ -60,5 +59,4 @@ | ||
## License | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9068
160
1
0
58