@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/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
- const selectors = block.selector.split(/([\s*,>+~])/).filter((s) => !!s.trim()).map((s) => {
2061
- if (s.length === 1 && "*,>+~".includes(s)) {
2062
- return s;
2063
- } else if (globalStyleRegex.test(s)) {
2064
- return s.match(globalStyleRegex)[1];
2065
- } else {
2066
- return `${s}.torp-${styleHash}`;
2067
- }
2068
- });
2069
- b.append(`${selectors.join(" ")} {`);
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
  }