jss-isolate
Advanced tools
Comparing version 1.0.3 to 2.0.0
@@ -0,1 +1,5 @@ | ||
## 2.0.0 / 2016-12-09 | ||
- update jss to 6.0 | ||
## 1.0.3 / 2016-11-23 | ||
@@ -2,0 +6,0 @@ |
@@ -112,3 +112,6 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
link: true, | ||
meta: 'jss-isolate' | ||
meta: 'jss-isolate', | ||
// Lets make it always the first one in sheets for testing | ||
// and specificity. | ||
index: -Infinity | ||
}); | ||
@@ -115,0 +118,0 @@ var mergedReset = options.reset ? _extends({}, _reset2['default'], options.reset) : _reset2['default']; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jssIsolate=t():e.jssIsolate=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null,o=void 0,n=[];return function(r){if("regular"===r.type&&r.options.sheet&&r.options.sheet!==t&&r.options.sheet.options.isolate!==!1&&(!r.options.parent||"keyframe"!==r.options.parent.type)){if(r.style&&r.style.isolate===!1)return void delete r.style.isolate;if(!t&&r.options.jss){t=r.options.jss.createStyleSheet({},{link:!0,meta:"jss-isolate"});var i=e.reset?s({},a.default,e.reset):a.default;o=t.addRule("reset",i),t.attach()}n.indexOf(r.selector)===-1&&n.push(r.selector),u(o,n)}}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e};t.default=r;var i=o(1),a=n(i),l=function(e){var t=void 0;return function(){for(var o=arguments.length,n=Array(o),r=0;r<o;r++)n[r]=arguments[r];clearTimeout(t),t=setTimeout(function(){return e.apply(void 0,n)})}},u=l(function(e,t){e.selector=t.join(",\n")})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"border-collapse":"separate","border-spacing":"0","caption-side":"top",cursor:"auto",direction:"ltr","empty-cells":"show","font-family":"serif","font-size":"medium","font-style":"normal","font-variant":"normal","font-weight":"normal","font-stretch":"normal","line-height":"normal",hyphens:"none","letter-spacing":"normal","list-style":"disc outside none","tab-size":"8","text-align":"left","text-align-last":"auto","text-indent":"0","text-shadow":"none","text-transform":"none",visibility:"visible","white-space":"normal",widows:"2","word-spacing":"normal"}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jssIsolate=t():e.jssIsolate=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null,o=void 0,n=[];return function(r){if("regular"===r.type&&r.options.sheet&&r.options.sheet!==t&&r.options.sheet.options.isolate!==!1&&(!r.options.parent||"keyframe"!==r.options.parent.type)){if(r.style&&r.style.isolate===!1)return void delete r.style.isolate;if(!t&&r.options.jss){t=r.options.jss.createStyleSheet({},{link:!0,meta:"jss-isolate",index:-(1/0)});var i=e.reset?s({},a.default,e.reset):a.default;o=t.addRule("reset",i),t.attach()}n.indexOf(r.selector)===-1&&n.push(r.selector),u(o,n)}}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e};t.default=r;var i=o(1),a=n(i),l=function(e){var t=void 0;return function(){for(var o=arguments.length,n=Array(o),r=0;r<o;r++)n[r]=arguments[r];clearTimeout(t),t=setTimeout(function(){return e.apply(void 0,n)})}},u=l(function(e,t){e.selector=t.join(",\n")})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"border-collapse":"separate","border-spacing":"0","caption-side":"top",cursor:"auto",direction:"ltr","empty-cells":"show","font-family":"serif","font-size":"medium","font-style":"normal","font-variant":"normal","font-weight":"normal","font-stretch":"normal","line-height":"normal",hyphens:"none","letter-spacing":"normal","list-style":"disc outside none","tab-size":"8","text-align":"left","text-align-last":"auto","text-indent":"0","text-shadow":"none","text-transform":"none",visibility:"visible","white-space":"normal",widows:"2","word-spacing":"normal"}}])}); | ||
//# sourceMappingURL=jss-isolate.min.js.map |
@@ -56,3 +56,6 @@ 'use strict'; | ||
link: true, | ||
meta: 'jss-isolate' | ||
meta: 'jss-isolate', | ||
// Lets make it always the first one in sheets for testing | ||
// and specificity. | ||
index: -Infinity | ||
}); | ||
@@ -59,0 +62,0 @@ var mergedReset = options.reset ? _extends({}, _reset2['default'], options.reset) : _reset2['default']; |
@@ -23,5 +23,6 @@ 'use strict'; | ||
afterEach(function () { | ||
jss.sheets.registry.forEach(function (sheet) { | ||
_jss.sheets.registry.forEach(function (sheet) { | ||
return sheet.detach(); | ||
}); | ||
_jss.sheets.reset(); | ||
}); | ||
@@ -35,3 +36,3 @@ | ||
it('should have no reset sheets in registry', function () { | ||
(0, _expect2['default'])(jss.sheets.registry.length).to.be(1); | ||
(0, _expect2['default'])(_jss.sheets.registry.length).to.be(1); | ||
}); | ||
@@ -58,3 +59,3 @@ }); | ||
it('should have no reset sheets in registry', function () { | ||
(0, _expect2['default'])(jss.sheets.registry.length).to.be(1); | ||
(0, _expect2['default'])(_jss.sheets.registry.length).to.be(1); | ||
}); | ||
@@ -79,3 +80,3 @@ }); | ||
it('should add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.contain(sheet.classes.linkItem); | ||
@@ -86,3 +87,3 @@ (0, _expect2['default'])(resetRule.selector).to.contain(sheet.classes.link); | ||
it('should have expected reset props', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.prop('border-collapse')).to.be('separate'); | ||
@@ -112,3 +113,3 @@ (0, _expect2['default'])(resetRule.prop('font-family')).to.be('serif'); | ||
it('should add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.contain(sheet1.classes.link); | ||
@@ -138,3 +139,3 @@ (0, _expect2['default'])(resetRule.selector).to.contain(sheet2.classes.linkItem); | ||
it('should not add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.contain(sheet1.classes.link); | ||
@@ -162,3 +163,3 @@ (0, _expect2['default'])(resetRule.selector).not.to.contain(sheet2.classes.linkItem); | ||
it('should add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.contain(sheet.classes.link); | ||
@@ -191,3 +192,3 @@ (0, _expect2['default'])(resetRule.selector).not.to.contain(sheet.classes.linkItem); | ||
it('should add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.be('.' + sheet.classes.link); | ||
@@ -214,3 +215,3 @@ }); | ||
it('should add width prop to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.prop('width')).to.be('1px'); | ||
@@ -226,3 +227,3 @@ }); | ||
(0, _expect2['default'])(jss.sheets.registry.length).to.be(0); | ||
(0, _expect2['default'])(_jss.sheets.registry.length).to.be(0); | ||
}); | ||
@@ -229,0 +230,0 @@ |
{ | ||
"name": "jss-isolate", | ||
"description": "True rules isolation through automatic inheritable properties reset.", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"author": { | ||
@@ -60,3 +60,3 @@ "name": "Maksim Koretskiy", | ||
"expect.js": "^0.3.1", | ||
"jss": "^5.5.2", | ||
"jss": "^6.0.0", | ||
"karma": "^1.1.1", | ||
@@ -79,3 +79,3 @@ "karma-benchmark": "^0.6.0", | ||
"peerDependencies": { | ||
"jss": "^5.5.6" | ||
"jss": "^6.0.0" | ||
}, | ||
@@ -82,0 +82,0 @@ "lint-staged": { |
@@ -1,5 +0,3 @@ | ||
![JSS logo](https://avatars1.githubusercontent.com/u/9503099?v=3&s=60) | ||
# True rules isolation through automatic inheritable properties reset | ||
## True rules isolation through automatic inheritable properties reset. | ||
There is a category of css properties named 'inheritable'. It means that these properties apply to the child nodes from parent nodes. See [this article]( | ||
@@ -6,0 +4,0 @@ https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Cascading_and_inheritance) for more details. |
@@ -56,3 +56,6 @@ 'use strict'; | ||
link: true, | ||
meta: 'jss-isolate' | ||
meta: 'jss-isolate', | ||
// Lets make it always the first one in sheets for testing | ||
// and specificity. | ||
index: -Infinity | ||
}); | ||
@@ -59,0 +62,0 @@ var mergedReset = options.reset ? _extends({}, _reset2['default'], options.reset) : _reset2['default']; |
@@ -23,5 +23,6 @@ 'use strict'; | ||
afterEach(function () { | ||
jss.sheets.registry.forEach(function (sheet) { | ||
_jss.sheets.registry.forEach(function (sheet) { | ||
return sheet.detach(); | ||
}); | ||
_jss.sheets.reset(); | ||
}); | ||
@@ -35,3 +36,3 @@ | ||
it('should have no reset sheets in registry', function () { | ||
(0, _expect2['default'])(jss.sheets.registry.length).to.be(1); | ||
(0, _expect2['default'])(_jss.sheets.registry.length).to.be(1); | ||
}); | ||
@@ -58,3 +59,3 @@ }); | ||
it('should have no reset sheets in registry', function () { | ||
(0, _expect2['default'])(jss.sheets.registry.length).to.be(1); | ||
(0, _expect2['default'])(_jss.sheets.registry.length).to.be(1); | ||
}); | ||
@@ -79,3 +80,3 @@ }); | ||
it('should add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.contain(sheet.classes.linkItem); | ||
@@ -86,3 +87,3 @@ (0, _expect2['default'])(resetRule.selector).to.contain(sheet.classes.link); | ||
it('should have expected reset props', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.prop('border-collapse')).to.be('separate'); | ||
@@ -112,3 +113,3 @@ (0, _expect2['default'])(resetRule.prop('font-family')).to.be('serif'); | ||
it('should add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.contain(sheet1.classes.link); | ||
@@ -138,3 +139,3 @@ (0, _expect2['default'])(resetRule.selector).to.contain(sheet2.classes.linkItem); | ||
it('should not add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.contain(sheet1.classes.link); | ||
@@ -162,3 +163,3 @@ (0, _expect2['default'])(resetRule.selector).not.to.contain(sheet2.classes.linkItem); | ||
it('should add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.contain(sheet.classes.link); | ||
@@ -191,3 +192,3 @@ (0, _expect2['default'])(resetRule.selector).not.to.contain(sheet.classes.linkItem); | ||
it('should add selectors to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.selector).to.be('.' + sheet.classes.link); | ||
@@ -214,3 +215,3 @@ }); | ||
it('should add width prop to the reset rule', function () { | ||
var resetRule = jss.sheets.registry[0].getRule('reset'); | ||
var resetRule = _jss.sheets.registry[0].getRule('reset'); | ||
(0, _expect2['default'])(resetRule.prop('width')).to.be('1px'); | ||
@@ -226,3 +227,3 @@ }); | ||
(0, _expect2['default'])(jss.sheets.registry.length).to.be(0); | ||
(0, _expect2['default'])(_jss.sheets.registry.length).to.be(0); | ||
}); | ||
@@ -229,0 +230,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
53673
777
99