@torpor/view 0.1.4 → 0.1.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 +14 -10
- package/dist/compile.cjs.map +1 -1
- package/dist/compile.js +14 -10
- package/dist/compile.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
- package/src/compile/build/client/buildStyles.ts +18 -14
package/CHANGELOG.md
CHANGED
package/dist/compile.cjs
CHANGED
|
@@ -2083,16 +2083,20 @@ function buildStyles(style, styleHash) {
|
|
|
2083
2083
|
}
|
|
2084
2084
|
var globalStyleRegex = /\:global\((.+)\)/;
|
|
2085
2085
|
function buildStyleBlock(block, b, styleHash) {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2086
|
+
if (block.selector.startsWith("@")) {
|
|
2087
|
+
b.append(`${block.selector} {`);
|
|
2088
|
+
} else {
|
|
2089
|
+
const selectors = block.selector.split(/([\s*,>+~])/).filter((s) => !!s.trim()).map((s) => {
|
|
2090
|
+
if (s.length === 1 && "*,>+~".includes(s)) {
|
|
2091
|
+
return s;
|
|
2092
|
+
} else if (globalStyleRegex.test(s)) {
|
|
2093
|
+
return s.match(globalStyleRegex)[1];
|
|
2094
|
+
} else {
|
|
2095
|
+
return `${s}.torp-${styleHash}`;
|
|
2096
|
+
}
|
|
2097
|
+
});
|
|
2098
|
+
b.append(`${selectors.join(" ")} {`);
|
|
2099
|
+
}
|
|
2096
2100
|
for (let attribute of block.attributes) {
|
|
2097
2101
|
buildStyleAttribute(attribute, b);
|
|
2098
2102
|
}
|