@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/dist/compile.js
CHANGED
|
@@ -2057,16 +2057,20 @@ function buildStyles(style, styleHash) {
|
|
|
2057
2057
|
}
|
|
2058
2058
|
var globalStyleRegex = /\:global\((.+)\)/;
|
|
2059
2059
|
function buildStyleBlock(block, b, styleHash) {
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2060
|
+
if (block.selector.startsWith("@")) {
|
|
2061
|
+
b.append(`${block.selector} {`);
|
|
2062
|
+
} else {
|
|
2063
|
+
const selectors = block.selector.split(/([\s*,>+~])/).filter((s) => !!s.trim()).map((s) => {
|
|
2064
|
+
if (s.length === 1 && "*,>+~".includes(s)) {
|
|
2065
|
+
return s;
|
|
2066
|
+
} else if (globalStyleRegex.test(s)) {
|
|
2067
|
+
return s.match(globalStyleRegex)[1];
|
|
2068
|
+
} else {
|
|
2069
|
+
return `${s}.torp-${styleHash}`;
|
|
2070
|
+
}
|
|
2071
|
+
});
|
|
2072
|
+
b.append(`${selectors.join(" ")} {`);
|
|
2073
|
+
}
|
|
2070
2074
|
for (let attribute of block.attributes) {
|
|
2071
2075
|
buildStyleAttribute(attribute, b);
|
|
2072
2076
|
}
|