jss-extend
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -62,4 +62,6 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
}); | ||
var warn = console.warn.bind(console); // eslint-disable-line no-console | ||
/** | ||
* Recursively extend style objects. | ||
* Recursively extend styles. | ||
*/ | ||
@@ -70,3 +72,5 @@ function extend(rule, newStyle, style) { | ||
var refRule = rule.options.sheet.getRule(style.extend); | ||
if (refRule) extend(rule, newStyle, refRule.originalStyle); | ||
if (refRule) { | ||
if (refRule === rule) warn('A rule tries to extend itself \r\n' + rule.toString());else extend(rule, newStyle, refRule.originalStyle); | ||
} | ||
} | ||
@@ -73,0 +77,0 @@ } else if (Array.isArray(style.extend)) { |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jssExtend=t():e.jssExtend=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){"use strict";function n(e,t,o){if("string"==typeof o.extend){if(e.options&&e.options.sheet){var r=e.options.sheet.getRule(o.extend);r&&n(e,t,r.originalStyle)}}else if(Array.isArray(o.extend))for(var s=0;s<o.extend.length;s++)n(e,t,o.extend[s]);else for(var i in o.extend)"extend"===i?n(e,t,o.extend.extend):t[i]=o.extend[i];for(var d in o)"extend"!==d&&(t[d]=o[d]);return t}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(){return function(e){e.style&&e.style.extend&&(e.style=n(e,{},e.style))}}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jssExtend=t():e.jssExtend=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){"use strict";function n(e,t,r){if("string"==typeof r.extend){if(e.options&&e.options.sheet){var s=e.options.sheet.getRule(r.extend);s&&(s===e?o("A rule tries to extend itself \r\n"+e.toString()):n(e,t,s.originalStyle))}}else if(Array.isArray(r.extend))for(var i=0;i<r.extend.length;i++)n(e,t,r.extend[i]);else for(var d in r.extend)"extend"===d?n(e,t,r.extend.extend):t[d]=r.extend[d];for(var f in r)"extend"!==f&&(t[f]=r[f]);return t}Object.defineProperty(t,"__esModule",{value:!0});var o=console.warn.bind(console);t["default"]=function(){return function(e){e.style&&e.style.extend&&(e.style=n(e,{},e.style))}}}])}); |
@@ -0,1 +1,5 @@ | ||
## 2.0.1 / 2016-08-01 | ||
- fix regression because of merge | ||
## 2.0.0 / 2016-08-01 | ||
@@ -2,0 +6,0 @@ |
@@ -6,4 +6,6 @@ 'use strict'; | ||
}); | ||
var warn = console.warn.bind(console); // eslint-disable-line no-console | ||
/** | ||
* Recursively extend style objects. | ||
* Recursively extend styles. | ||
*/ | ||
@@ -14,3 +16,5 @@ function extend(rule, newStyle, style) { | ||
var refRule = rule.options.sheet.getRule(style.extend); | ||
if (refRule) extend(rule, newStyle, refRule.originalStyle); | ||
if (refRule) { | ||
if (refRule === rule) warn('A rule tries to extend itself \r\n' + rule.toString());else extend(rule, newStyle, refRule.originalStyle); | ||
} | ||
} | ||
@@ -17,0 +21,0 @@ } else if (Array.isArray(style.extend)) { |
{ | ||
"name": "jss-extend", | ||
"description": "JSS plugin that enables inheritance", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Oleg Slobodskoi", |
@@ -7,7 +7,8 @@ ![JSS logo](https://avatars1.githubusercontent.com/u/9503099?v=3&s=60) | ||
[Demo](http://jsstyles.github.io/examples/index.html#plugin-jss-extend) - | ||
[JSS](https://github.com/jsstyles/jss) | ||
[Demo](http://cssinjs.github.io/examples/index.html#plugin-jss-extend) - | ||
[JSS](https://github.com/cssinjs/jss) | ||
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/jsstyles/jss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/cssinjs/lobby) | ||
Value of `extend` property can be a string, object and array. If string is used, it will look for a rule with such a name. If object - plain rule object is expected, if array - an array of plain rule obejcts is expected. | ||
@@ -72,3 +73,3 @@ | ||
File a bug against [jsstyles/jss prefixed with \[jss-extend\]](https://github.com/jsstyles/jss/issues/new?title=[jss-extend]%20). | ||
File a bug against [cssinjs/jss prefixed with \[jss-extend\]](https://github.com/cssinjs/jss/issues/new?title=[jss-extend]%20). | ||
@@ -75,0 +76,0 @@ ## Run tests |
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
11059
160
84