jss-plugin-isolate
Advanced tools
Comparing version 10.7.1 to 10.8.0
@@ -383,4 +383,3 @@ function _extends() { | ||
var isolate = options.isolate == null ? true : options.isolate; // $FlowFixMe[prop-missing] isolate is only added as an option by this plugin which means we can't type it in jss | ||
var isolate = options.isolate == null ? true : options.isolate; | ||
if (sheet.options.isolate != null) isolate = sheet.options.isolate; | ||
@@ -387,0 +386,0 @@ |
@@ -57,4 +57,3 @@ 'use strict'; | ||
var isolate = options.isolate == null ? true : options.isolate; // $FlowFixMe[prop-missing] isolate is only added as an option by this plugin which means we can't type it in jss | ||
var isolate = options.isolate == null ? true : options.isolate; | ||
if (sheet.options.isolate != null) isolate = sheet.options.isolate; | ||
@@ -61,0 +60,0 @@ |
@@ -47,4 +47,3 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
var isolate = options.isolate == null ? true : options.isolate; // $FlowFixMe[prop-missing] isolate is only added as an option by this plugin which means we can't type it in jss | ||
var isolate = options.isolate == null ? true : options.isolate; | ||
if (sheet.options.isolate != null) isolate = sheet.options.isolate; | ||
@@ -51,0 +50,0 @@ |
@@ -389,4 +389,3 @@ (function (global, factory) { | ||
var isolate = options.isolate == null ? true : options.isolate; // $FlowFixMe[prop-missing] isolate is only added as an option by this plugin which means we can't type it in jss | ||
var isolate = options.isolate == null ? true : options.isolate; | ||
if (sheet.options.isolate != null) isolate = sheet.options.isolate; | ||
@@ -393,0 +392,0 @@ |
{ | ||
"name": "jss-plugin-isolate", | ||
"description": "True rules isolation through automatic properties reset.", | ||
"version": "10.7.1", | ||
"version": "10.8.0", | ||
"license": "MIT", | ||
@@ -41,5 +41,5 @@ "homepage": "https://cssinjs.org/jss-plugin-isolate", | ||
"css-initials": "^0.3.1", | ||
"jss": "10.7.1" | ||
"jss": "10.8.0" | ||
}, | ||
"gitHead": "2b54776c03d97a3bccbbcb28b63508f74103ebbc" | ||
"gitHead": "d2e1aea99b2a8a9c2d8725df1dfcd222d2504a7a" | ||
} |
@@ -11,3 +11,3 @@ # jss-plugin-isolate | ||
See our website [jss-plugin-isolate](https://cssinjs.org/jss-plugin-isolate?v=v10.7.1) for more information. | ||
See our website [jss-plugin-isolate](https://cssinjs.org/jss-plugin-isolate?v=v10.8.0) for more information. | ||
@@ -14,0 +14,0 @@ ## Install |
@@ -1,11 +0,4 @@ | ||
// @flow | ||
import inheritedInitials from 'css-initials/inherited' | ||
import allInitials from 'css-initials/all' | ||
import type {Plugin, StyleRule} from 'jss' | ||
type Options = { | ||
isolate?: boolean | string, | ||
reset?: 'all' | 'inherited' | Object | ['all' | 'inherited', Object] | ||
} | ||
const resetSheetOptions = { | ||
@@ -42,3 +35,3 @@ meta: 'jss-plugin-isolate', | ||
const shouldIsolate = (rule: StyleRule, sheet, options) => { | ||
const shouldIsolate = (rule, sheet, options) => { | ||
const {parent} = rule.options | ||
@@ -51,3 +44,2 @@ | ||
let isolate = options.isolate == null ? true : options.isolate | ||
// $FlowFixMe[prop-missing] isolate is only added as an option by this plugin which means we can't type it in jss | ||
if (sheet.options.isolate != null) isolate = sheet.options.isolate | ||
@@ -85,7 +77,7 @@ if (rule.style.isolate != null) { | ||
export default function jssIsolate(options: Options = {}): Plugin { | ||
export default function jssIsolate(options = {}) { | ||
let setSelectorDone = false | ||
const selectors = [] | ||
let resetSheet | ||
let resetRule: StyleRule | ||
let resetRule | ||
@@ -102,3 +94,3 @@ const setSelector = () => { | ||
// Type it as a StyleRule | ||
const styleRule: StyleRule = (rule: any) | ||
const styleRule = rule | ||
@@ -110,3 +102,3 @@ if (!shouldIsolate(styleRule, sheet, options)) return | ||
resetSheet = rule.options.jss.createStyleSheet({}, resetSheetOptions) | ||
resetRule = ((resetSheet.addRule('reset', getStyle(options.reset)): any): StyleRule) | ||
resetRule = resetSheet.addRule('reset', getStyle(options.reset)) | ||
resetSheet.attach() | ||
@@ -113,0 +105,0 @@ } |
Sorry, the diff of this file is not supported yet
13
79217
1234
+ Addedjss@10.8.0(transitive)
- Removedjss@10.7.1(transitive)
Updatedjss@10.8.0