zss-engine 1.2.2 → 2.0.0

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.
@@ -50,7 +50,9 @@ function transpile(object, base36Hash, core) {
50
50
  }
51
51
  else if (!property.startsWith('@')) {
52
52
  const kebabPseudoSelector = (0, helper_js_1.camelToKebabCase)(property.replace('&', ''));
53
- const styles = stringConverter(className + kebabPseudoSelector, value, indentLevel);
53
+ const isPseudo = property.startsWith(':') || property.startsWith('&');
54
+ const selector = isPseudo ? className + ':not(#\\#)' + kebabPseudoSelector : className + kebabPseudoSelector;
55
+ const styles = stringConverter(selector, value, indentLevel);
54
56
  Object.assign(classSelector, styles);
55
57
  }
56
58
  else if (property.startsWith('@media') || property.startsWith('@container')) {
@@ -64,6 +66,7 @@ function transpile(object, base36Hash, core) {
64
66
  const isAnd = mediaProp.startsWith('&');
65
67
  if (isColon || isAnd) {
66
68
  const kebabMediaProp = (0, helper_js_1.camelToKebabCase)(mediaProp.replace('&', ''));
69
+ const increaseKebabMediaProp = ':not(#\\#)' + kebabMediaProp;
67
70
  let pseudoClassRule = '';
68
71
  if (typeof mediaValue === 'object' && mediaValue !== null) {
69
72
  for (const pseudoProp in mediaValue) {
@@ -74,7 +77,7 @@ function transpile(object, base36Hash, core) {
74
77
  }
75
78
  }
76
79
  }
77
- nestedRules += `${innerIndent}${className}${kebabMediaProp} {\n${pseudoClassRule}${innerIndent}}\n`;
80
+ nestedRules += `${innerIndent}${className}${increaseKebabMediaProp} {\n${pseudoClassRule}${innerIndent}}\n`;
78
81
  }
79
82
  else {
80
83
  const CSSProp = (0, helper_js_1.camelToKebabCase)(mediaProp);
@@ -47,7 +47,9 @@ export function transpile(object, base36Hash, core) {
47
47
  }
48
48
  else if (!property.startsWith('@')) {
49
49
  const kebabPseudoSelector = camelToKebabCase(property.replace('&', ''));
50
- const styles = stringConverter(className + kebabPseudoSelector, value, indentLevel);
50
+ const isPseudo = property.startsWith(':') || property.startsWith('&');
51
+ const selector = isPseudo ? className + ':not(#\\#)' + kebabPseudoSelector : className + kebabPseudoSelector;
52
+ const styles = stringConverter(selector, value, indentLevel);
51
53
  Object.assign(classSelector, styles);
52
54
  }
53
55
  else if (property.startsWith('@media') || property.startsWith('@container')) {
@@ -61,6 +63,7 @@ export function transpile(object, base36Hash, core) {
61
63
  const isAnd = mediaProp.startsWith('&');
62
64
  if (isColon || isAnd) {
63
65
  const kebabMediaProp = camelToKebabCase(mediaProp.replace('&', ''));
66
+ const increaseKebabMediaProp = ':not(#\\#)' + kebabMediaProp;
64
67
  let pseudoClassRule = '';
65
68
  if (typeof mediaValue === 'object' && mediaValue !== null) {
66
69
  for (const pseudoProp in mediaValue) {
@@ -71,7 +74,7 @@ export function transpile(object, base36Hash, core) {
71
74
  }
72
75
  }
73
76
  }
74
- nestedRules += `${innerIndent}${className}${kebabMediaProp} {\n${pseudoClassRule}${innerIndent}}\n`;
77
+ nestedRules += `${innerIndent}${className}${increaseKebabMediaProp} {\n${pseudoClassRule}${innerIndent}}\n`;
75
78
  }
76
79
  else {
77
80
  const CSSProp = camelToKebabCase(mediaProp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zss-engine",
3
- "version": "1.2.2",
3
+ "version": "2.0.0",
4
4
  "description": "Zero-runtime StyleSheet Engine",
5
5
  "funding": "https://github.com/sponsors/refirst11",
6
6
  "author": "Refirst 11",