@torpor/view 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/compile.cjs +8 -10
- package/dist/compile.cjs.map +1 -1
- package/dist/compile.js +8 -10
- package/dist/compile.js.map +1 -1
- package/package.json +1 -1
- package/src/compile/parse/scopeStyles.ts +13 -12
package/CHANGELOG.md
CHANGED
package/dist/compile.cjs
CHANGED
|
@@ -3363,16 +3363,14 @@ function scopeStyles(status) {
|
|
|
3363
3363
|
}
|
|
3364
3364
|
}
|
|
3365
3365
|
function scopeStylesOnNode(node, selectors) {
|
|
3366
|
-
if (isElementNode(node) || isComponentNode(node)) {
|
|
3367
|
-
|
|
3368
|
-
if (
|
|
3369
|
-
if (
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
node.scopeStyles = scopeStyles$1;
|
|
3375
|
-
}
|
|
3366
|
+
if (isElementNode(node) || isComponentNode(node)) node.scopeStyles = selectors.includes(node.tagName) || node.attributes.find((a) => {
|
|
3367
|
+
if (a.name === "class" && a.reactive) return true;
|
|
3368
|
+
else if (a.name === "id" && a.value) {
|
|
3369
|
+
if (selectors.includes(`#${trimQuotes(a.value)}`)) return true;
|
|
3370
|
+
} else if (a.name === "class" && a.value) {
|
|
3371
|
+
for (let classname of trimQuotes(a.value).split(/\s+/)) if (selectors.includes(`.${classname}`)) return true;
|
|
3372
|
+
}
|
|
3373
|
+
}) !== void 0;
|
|
3376
3374
|
if (isParentNode(node)) for (let child of node.children) scopeStylesOnNode(child, selectors);
|
|
3377
3375
|
}
|
|
3378
3376
|
function collectStyleSelectors(block, selectors) {
|