@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @torpor/view
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - f390b78: Fix: don't scope media queries and CSS properties
8
+
3
9
  ## 0.1.4
4
10
 
5
11
  ### Patch Changes
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
- const selectors = block.selector.split(/([\s*,>+~])/).filter((s) => !!s.trim()).map((s) => {
2087
- if (s.length === 1 && "*,>+~".includes(s)) {
2088
- return s;
2089
- } else if (globalStyleRegex.test(s)) {
2090
- return s.match(globalStyleRegex)[1];
2091
- } else {
2092
- return `${s}.torp-${styleHash}`;
2093
- }
2094
- });
2095
- b.append(`${selectors.join(" ")} {`);
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
  }