@master/css 2.0.0-rc.3 → 2.0.0-rc.31

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.
Files changed (109) hide show
  1. package/README.md +4 -43
  2. package/dist/_virtual/_commonjsHelpers.cjs +5 -0
  3. package/dist/_virtual/_commonjsHelpers.mjs +3 -0
  4. package/dist/_virtual/css-escape.cjs +5 -0
  5. package/dist/_virtual/css-escape.mjs +3 -0
  6. package/dist/bin/index.cjs +11 -0
  7. package/dist/bin/index.d.ts +0 -1
  8. package/dist/bin/index.mjs +9 -0
  9. package/dist/common.cjs +145 -0
  10. package/dist/common.d.ts +25 -0
  11. package/dist/common.mjs +124 -0
  12. package/dist/config/animations.cjs +113 -0
  13. package/dist/config/animations.mjs +111 -0
  14. package/dist/config/functions.cjs +351 -0
  15. package/dist/config/functions.mjs +349 -0
  16. package/dist/config/index.cjs +36 -0
  17. package/dist/config/index.d.ts +15 -12
  18. package/dist/config/index.mjs +26 -0
  19. package/dist/config/modes.cjs +8 -0
  20. package/dist/config/modes.d.ts +3 -0
  21. package/dist/config/modes.mjs +6 -0
  22. package/dist/config/queries.cjs +17 -0
  23. package/dist/config/queries.d.ts +22 -0
  24. package/dist/config/queries.mjs +15 -0
  25. package/dist/config/rules.cjs +2303 -0
  26. package/dist/config/rules.d.ts +8 -5
  27. package/dist/config/rules.mjs +2298 -0
  28. package/dist/config/selectors.cjs +28 -0
  29. package/dist/config/selectors.d.ts +0 -1
  30. package/dist/config/selectors.mjs +26 -0
  31. package/dist/config/styles.cjs +2 -0
  32. package/dist/config/styles.mjs +1 -0
  33. package/dist/config/utilities.cjs +191 -0
  34. package/dist/config/{semantics.d.ts → utilities.d.ts} +2 -5
  35. package/dist/config/utilities.mjs +189 -0
  36. package/dist/config/variables.cjs +116 -0
  37. package/dist/config/variables.d.ts +132 -177
  38. package/dist/config/variables.mjs +114 -0
  39. package/dist/core.cjs +1046 -0
  40. package/dist/core.d.ts +35 -31
  41. package/dist/core.mjs +1041 -0
  42. package/dist/index.cjs +72 -0
  43. package/dist/index.d.ts +15 -8
  44. package/dist/index.mjs +22 -0
  45. package/dist/layer.cjs +28 -0
  46. package/dist/layer.d.ts +26 -9
  47. package/dist/layer.mjs +26 -0
  48. package/dist/polyfills/css-escape.cjs +8 -0
  49. package/dist/polyfills/css-escape.mjs +2 -0
  50. package/dist/polyfills/css-escape2.cjs +68 -0
  51. package/dist/polyfills/css-escape2.mjs +64 -0
  52. package/dist/rule.cjs +722 -0
  53. package/dist/rule.d.ts +60 -22
  54. package/dist/rule.mjs +720 -0
  55. package/dist/shared/utils/css-escape.cjs +56 -0
  56. package/dist/shared/utils/css-escape.mjs +54 -0
  57. package/dist/tokens/screen-sizes.cjs +17 -0
  58. package/dist/tokens/screen-sizes.mjs +15 -0
  59. package/dist/types/global.cjs +2 -0
  60. package/dist/types/global.d.ts +3 -3
  61. package/dist/types/global.mjs +1 -0
  62. package/dist/utils/are-rule-modes-equal.cjs +7 -0
  63. package/dist/utils/are-rule-modes-equal.d.ts +2 -0
  64. package/dist/utils/are-rule-modes-equal.mjs +5 -0
  65. package/dist/utils/are-rule-queries-equal.cjs +22 -0
  66. package/dist/utils/are-rule-queries-equal.d.ts +2 -0
  67. package/dist/utils/are-rule-queries-equal.mjs +20 -0
  68. package/dist/utils/are-rule-selectors-equal.cjs +29 -0
  69. package/dist/utils/are-rule-selectors-equal.d.ts +2 -0
  70. package/dist/utils/are-rule-selectors-equal.mjs +27 -0
  71. package/dist/utils/are-rule-states-equal.cjs +11 -0
  72. package/dist/utils/are-rule-states-equal.d.ts +2 -0
  73. package/dist/utils/are-rule-states-equal.mjs +9 -0
  74. package/dist/utils/are-rules-duplicated.cjs +17 -0
  75. package/dist/utils/are-rules-duplicated.d.ts +2 -0
  76. package/dist/utils/are-rules-duplicated.mjs +15 -0
  77. package/dist/utils/extend-config.cjs +72 -0
  78. package/dist/utils/extend-config.d.ts +1 -1
  79. package/dist/utils/extend-config.mjs +70 -0
  80. package/dist/utils/flatten-object.cjs +15 -0
  81. package/dist/utils/flatten-object.mjs +13 -0
  82. package/dist/utils/generate-css.cjs +13 -0
  83. package/dist/utils/generate-css.d.ts +2 -0
  84. package/dist/utils/generate-css.mjs +11 -0
  85. package/dist/utils/hex-to-rgb.cjs +30 -0
  86. package/dist/utils/hex-to-rgb.d.ts +1 -1
  87. package/dist/utils/hex-to-rgb.mjs +28 -0
  88. package/dist/utils/is-core-rule.cjs +9 -0
  89. package/dist/utils/is-core-rule.d.ts +1 -0
  90. package/dist/utils/is-core-rule.mjs +7 -0
  91. package/dist/utils/reorder-for-readable-classes.cjs +62 -0
  92. package/dist/{functions → utils}/reorder-for-readable-classes.d.ts +2 -6
  93. package/dist/utils/reorder-for-readable-classes.mjs +60 -0
  94. package/package.json +1 -1
  95. package/dist/bin/index.bundle.js +0 -36
  96. package/dist/config/media-queries.d.ts +0 -1
  97. package/dist/constants/base-unit-regex.d.ts +0 -1
  98. package/dist/constants/config-esm-text.d.ts +0 -1
  99. package/dist/constants/config-text.d.ts +0 -1
  100. package/dist/constants/config-ts-text.d.ts +0 -1
  101. package/dist/constants/start-symbol.d.ts +0 -6
  102. package/dist/functions/transform-color-with-opacity.d.ts +0 -1
  103. package/dist/index.bundle.js +0 -35
  104. package/dist/index.bundle.mjs +0 -35
  105. package/dist/utils/concat-arrays.d.ts +0 -1
  106. package/dist/utils/get-type.d.ts +0 -7
  107. package/dist/utils/is-plain-object.d.ts +0 -8
  108. package/dist/utils/is-symbol.d.ts +0 -7
  109. package/dist/utils/rgb-to-hex.d.ts +0 -1
package/dist/index.cjs ADDED
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var index = require('./config/index.cjs');
6
+ var rule = require('./rule.cjs');
7
+ var common = require('./common.cjs');
8
+ var core = require('./core.cjs');
9
+ var layer = require('./layer.cjs');
10
+ var extendConfig = require('./utils/extend-config.cjs');
11
+ var reorderForReadableClasses = require('./utils/reorder-for-readable-classes.cjs');
12
+ var areRuleModesEqual = require('./utils/are-rule-modes-equal.cjs');
13
+ var areRuleQueriesEqual = require('./utils/are-rule-queries-equal.cjs');
14
+ var areRuleSelectorsEqual = require('./utils/are-rule-selectors-equal.cjs');
15
+ var areRuleStatesEqual = require('./utils/are-rule-states-equal.cjs');
16
+ var areRulesDuplicated = require('./utils/are-rules-duplicated.cjs');
17
+ var generateCss = require('./utils/generate-css.cjs');
18
+ var isCoreRule = require('./utils/is-core-rule.cjs');
19
+ var queries = require('./config/queries.cjs');
20
+ var selectors = require('./config/selectors.cjs');
21
+ var utilities = require('./config/utilities.cjs');
22
+ var functions = require('./config/functions.cjs');
23
+ var animations = require('./config/animations.cjs');
24
+ var variables = require('./config/variables.cjs');
25
+ var modes = require('./config/modes.cjs');
26
+ var rules = require('./config/rules.cjs');
27
+
28
+
29
+
30
+ exports.config = index.config;
31
+ exports.Rule = rule.Rule;
32
+ exports.ANIMATION_SIGN = common.ANIMATION_SIGN;
33
+ exports.AT_SIGN = common.AT_SIGN;
34
+ exports.BASE_UNIT_REGEX = common.BASE_UNIT_REGEX;
35
+ exports.CLASS_ATTRIBUTES = common.CLASS_ATTRIBUTES;
36
+ exports.CLASS_DECLARATIONS = common.CLASS_DECLARATIONS;
37
+ exports.CLASS_FUNCTIONS = common.CLASS_FUNCTIONS;
38
+ exports.COLOR_VALUE_REGEX = common.COLOR_VALUE_REGEX;
39
+ exports.DELIMITER_SIGN = common.DELIMITER_SIGN;
40
+ exports.IMAGE_VALUE_REGEX = common.IMAGE_VALUE_REGEX;
41
+ exports.NUMBER_VALUE_REGEX = common.NUMBER_VALUE_REGEX;
42
+ exports.OFFICIAL_URL = common.OFFICIAL_URL;
43
+ exports.QUERY_COMPARISON_OPERATORS = common.QUERY_COMPARISON_OPERATORS;
44
+ exports.QUERY_LOGICAL_OPERATORS = common.QUERY_LOGICAL_OPERATORS;
45
+ exports.SELECTOR_SIGNS = common.SELECTOR_SIGNS;
46
+ exports.SEPARATOR_SIGN = common.SEPARATOR_SIGN;
47
+ exports.SEPARATOR_SIGNS = common.SEPARATOR_SIGNS;
48
+ exports.TRANSITION_SIGN = common.TRANSITION_SIGN;
49
+ exports.UNIT_REGEX = common.UNIT_REGEX;
50
+ exports.VALUE_DELIMITERS = common.VALUE_DELIMITERS;
51
+ exports.VALUE_UNITS = common.VALUE_UNITS;
52
+ exports.MasterCSS = core.default;
53
+ exports.default = core.default;
54
+ exports.masterCSSs = core.masterCSSs;
55
+ exports.Layer = layer;
56
+ exports.extendConfig = extendConfig;
57
+ exports.reorderForReadableClasses = reorderForReadableClasses;
58
+ exports.areRuleModesEqual = areRuleModesEqual;
59
+ exports.areRuleQueriesEqual = areRuleQueriesEqual;
60
+ exports.areRuleSelectorsEqual = areRuleSelectorsEqual;
61
+ exports.areRuleStatesEqual = areRuleStatesEqual;
62
+ exports.areRulesDuplicated = areRulesDuplicated;
63
+ exports.generateCSS = generateCss;
64
+ exports.isCoreRule = isCoreRule;
65
+ exports.queries = queries;
66
+ exports.selectors = selectors;
67
+ exports.utilities = utilities;
68
+ exports.functions = functions;
69
+ exports.animations = animations;
70
+ exports.variables = variables;
71
+ exports.modes = modes;
72
+ exports.rules = rules.default;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,17 @@
1
- export { MasterCSS, MasterCSS as default } from './core';
1
+ export * from './config';
2
+ export * from './rule';
3
+ export * from './common';
4
+ export * from './core';
2
5
  export { Rule } from './rule';
6
+ export { default as Layer } from './layer';
7
+ export { default as MasterCSS, default } from './core';
8
+ export { default as extendConfig } from './utils/extend-config';
9
+ export { default as reorderForReadableClasses } from './utils/reorder-for-readable-classes';
10
+ export { default as areRuleModesEqual } from './utils/are-rule-modes-equal';
11
+ export { default as areRuleQueriesEqual } from './utils/are-rule-queries-equal';
12
+ export { default as areRuleSelectorsEqual } from './utils/are-rule-selectors-equal';
13
+ export { default as areRuleStatesEqual } from './utils/are-rule-states-equal';
14
+ export { default as areRulesDuplicated } from './utils/are-rules-duplicated';
15
+ export { default as generateCSS } from './utils/generate-css';
16
+ export { default as isCoreRule } from './utils/is-core-rule';
3
17
  export type { NativeRule, MediaFeatureComponent, MediaQuery } from './rule';
4
- export { CONFIG_TEXT } from './constants/config-text';
5
- export { CONFIG_ESM_TEXT } from './constants/config-esm-text';
6
- export { CONFIG_TS_TEXT } from './constants/config-ts-text';
7
- export { Layer } from './layer';
8
- export { default as extend } from '@techor/extend';
9
- export { default as reorderForReadableClasses } from './functions/reorder-for-readable-classes';
10
- export * from './config';
package/dist/index.mjs ADDED
@@ -0,0 +1,22 @@
1
+ export { config } from './config/index.mjs';
2
+ export { Rule } from './rule.mjs';
3
+ export { ANIMATION_SIGN, AT_SIGN, BASE_UNIT_REGEX, CLASS_ATTRIBUTES, CLASS_DECLARATIONS, CLASS_FUNCTIONS, COLOR_VALUE_REGEX, DELIMITER_SIGN, IMAGE_VALUE_REGEX, NUMBER_VALUE_REGEX, OFFICIAL_URL, QUERY_COMPARISON_OPERATORS, QUERY_LOGICAL_OPERATORS, SELECTOR_SIGNS, SEPARATOR_SIGN, SEPARATOR_SIGNS, TRANSITION_SIGN, UNIT_REGEX, VALUE_DELIMITERS, VALUE_UNITS } from './common.mjs';
4
+ export { default as MasterCSS, default, masterCSSs } from './core.mjs';
5
+ export { default as Layer } from './layer.mjs';
6
+ export { default as extendConfig } from './utils/extend-config.mjs';
7
+ export { default as reorderForReadableClasses } from './utils/reorder-for-readable-classes.mjs';
8
+ export { default as areRuleModesEqual } from './utils/are-rule-modes-equal.mjs';
9
+ export { default as areRuleQueriesEqual } from './utils/are-rule-queries-equal.mjs';
10
+ export { default as areRuleSelectorsEqual } from './utils/are-rule-selectors-equal.mjs';
11
+ export { default as areRuleStatesEqual } from './utils/are-rule-states-equal.mjs';
12
+ export { default as areRulesDuplicated } from './utils/are-rules-duplicated.mjs';
13
+ export { default as generateCSS } from './utils/generate-css.mjs';
14
+ export { default as isCoreRule } from './utils/is-core-rule.mjs';
15
+ export { default as queries } from './config/queries.mjs';
16
+ export { default as selectors } from './config/selectors.mjs';
17
+ export { default as utilities } from './config/utilities.mjs';
18
+ export { default as functions } from './config/functions.mjs';
19
+ export { default as animations } from './config/animations.mjs';
20
+ export { default as variables } from './config/variables.mjs';
21
+ export { default as modes } from './config/modes.mjs';
22
+ export { default as rules } from './config/rules.mjs';
package/dist/layer.cjs ADDED
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var Layer;
4
+ (function(Layer) {
5
+ /**
6
+ * utility classes
7
+ * @example block, inline
8
+ */ Layer[Layer["Utility"] = -4] = "Utility";
9
+ /**
10
+ * native shorthand
11
+ * @example border, padding, margin
12
+ */ Layer[Layer["NativeShorthand"] = -3] = "NativeShorthand";
13
+ /**
14
+ * shorthand
15
+ * @example px, py, mx, my
16
+ */ Layer[Layer["Shorthand"] = -2] = "Shorthand";
17
+ /**
18
+ * native properties
19
+ * @example color, background-color, font-size
20
+ */ Layer[Layer["Native"] = -1] = "Native";
21
+ /**
22
+ * normal
23
+ * @example grid-cols
24
+ */ Layer[Layer["Normal"] = 0] = "Normal";
25
+ })(Layer || (Layer = {}));
26
+ var Layer$1 = Layer;
27
+
28
+ module.exports = Layer$1;
package/dist/layer.d.ts CHANGED
@@ -1,11 +1,28 @@
1
- export declare const enum Layer {
2
- Semantic = -8,
3
- CoreNativeShorthand = -7,
4
- NativeShorthand = -6,
5
- CoreShorthand = -5,
6
- Shorthand = -4,
7
- CoreNative = -3,
8
- Native = -2,
9
- Core = -1,
1
+ declare const enum Layer {
2
+ /**
3
+ * utility classes
4
+ * @example block, inline
5
+ */
6
+ Utility = -4,
7
+ /**
8
+ * native shorthand
9
+ * @example border, padding, margin
10
+ */
11
+ NativeShorthand = -3,
12
+ /**
13
+ * shorthand
14
+ * @example px, py, mx, my
15
+ */
16
+ Shorthand = -2,
17
+ /**
18
+ * native properties
19
+ * @example color, background-color, font-size
20
+ */
21
+ Native = -1,
22
+ /**
23
+ * normal
24
+ * @example grid-cols
25
+ */
10
26
  Normal = 0
11
27
  }
28
+ export default Layer;
package/dist/layer.mjs ADDED
@@ -0,0 +1,26 @@
1
+ var Layer;
2
+ (function(Layer) {
3
+ /**
4
+ * utility classes
5
+ * @example block, inline
6
+ */ Layer[Layer["Utility"] = -4] = "Utility";
7
+ /**
8
+ * native shorthand
9
+ * @example border, padding, margin
10
+ */ Layer[Layer["NativeShorthand"] = -3] = "NativeShorthand";
11
+ /**
12
+ * shorthand
13
+ * @example px, py, mx, my
14
+ */ Layer[Layer["Shorthand"] = -2] = "Shorthand";
15
+ /**
16
+ * native properties
17
+ * @example color, background-color, font-size
18
+ */ Layer[Layer["Native"] = -1] = "Native";
19
+ /**
20
+ * normal
21
+ * @example grid-cols
22
+ */ Layer[Layer["Normal"] = 0] = "Normal";
23
+ })(Layer || (Layer = {}));
24
+ var Layer$1 = Layer;
25
+
26
+ export { Layer$1 as default };
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ require('./css-escape2.cjs');
4
+ var cssEscape = require('../_virtual/css-escape.cjs');
5
+
6
+
7
+
8
+ module.exports = cssEscape.__exports;
@@ -0,0 +1,2 @@
1
+ import './css-escape2.mjs';
2
+ export { __exports as default } from '../_virtual/css-escape.mjs';
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('../_virtual/_commonjsHelpers.cjs');
4
+
5
+ (()=>{
6
+ const root = typeof _commonjsHelpers.commonjsGlobal !== 'undefined' ? _commonjsHelpers.commonjsGlobal : window;
7
+ if (!root.CSS && !root.CSS?.escape) {
8
+ // https://drafts.csswg.org/cssom/#serialize-an-identifier
9
+ const cssEscape = function(value) {
10
+ if (arguments.length == 0) {
11
+ throw new TypeError('`CSS.escape` requires an argument.');
12
+ }
13
+ const string = String(value);
14
+ const length = string.length;
15
+ let index = -1;
16
+ let result = '';
17
+ let codeUnit;
18
+ const firstCodeUnit = string.charCodeAt(0);
19
+ if (// If the character is the first character and is a `-` (U+002D), and
20
+ // there is no second character, […]
21
+ length == 1 && firstCodeUnit == 0x002D) {
22
+ return '\\' + string;
23
+ }
24
+ while(++index < length){
25
+ codeUnit = string.charCodeAt(index);
26
+ // Note: there’s no need to special-case astral symbols, surrogate
27
+ // pairs, or lone surrogates.
28
+ // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
29
+ // (U+FFFD).
30
+ if (codeUnit == 0x0000) {
31
+ result += '\uFFFD';
32
+ continue;
33
+ }
34
+ if (// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
35
+ // U+007F, […]
36
+ codeUnit >= 0x0001 && codeUnit <= 0x001F || codeUnit == 0x007F || // If the character is the first character and is in the range [0-9]
37
+ // (U+0030 to U+0039), […]
38
+ index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039 || // If the character is the second character and is in the range [0-9]
39
+ // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
40
+ index == 1 && codeUnit >= 0x0030 && codeUnit <= 0x0039 && firstCodeUnit == 0x002D) {
41
+ // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
42
+ result += '\\' + codeUnit.toString(16) + ' ';
43
+ continue;
44
+ }
45
+ // If the character is not handled by one of the above rules and is
46
+ // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
47
+ // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
48
+ // U+005A), or [a-z] (U+0061 to U+007A), […]
49
+ if (codeUnit >= 0x0080 || codeUnit == 0x002D || codeUnit == 0x005F || codeUnit >= 0x0030 && codeUnit <= 0x0039 || codeUnit >= 0x0041 && codeUnit <= 0x005A || codeUnit >= 0x0061 && codeUnit <= 0x007A) {
50
+ // the character itself
51
+ result += string.charAt(index);
52
+ continue;
53
+ }
54
+ // Otherwise, the escaped character.
55
+ // https://drafts.csswg.org/cssom/#escape-a-character
56
+ result += '\\' + string.charAt(index);
57
+ }
58
+ return result;
59
+ };
60
+ if (!root.CSS) {
61
+ root.CSS = {};
62
+ }
63
+ root.CSS.escape = cssEscape;
64
+ globalThis.CSS.escape = cssEscape;
65
+ }
66
+ })();
67
+
68
+ module.exports = undefined;
@@ -0,0 +1,64 @@
1
+ import { commonjsGlobal } from '../_virtual/_commonjsHelpers.mjs';
2
+
3
+ (()=>{
4
+ const root = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : window;
5
+ if (!root.CSS && !root.CSS?.escape) {
6
+ // https://drafts.csswg.org/cssom/#serialize-an-identifier
7
+ const cssEscape = function(value) {
8
+ if (arguments.length == 0) {
9
+ throw new TypeError('`CSS.escape` requires an argument.');
10
+ }
11
+ const string = String(value);
12
+ const length = string.length;
13
+ let index = -1;
14
+ let result = '';
15
+ let codeUnit;
16
+ const firstCodeUnit = string.charCodeAt(0);
17
+ if (// If the character is the first character and is a `-` (U+002D), and
18
+ // there is no second character, […]
19
+ length == 1 && firstCodeUnit == 0x002D) {
20
+ return '\\' + string;
21
+ }
22
+ while(++index < length){
23
+ codeUnit = string.charCodeAt(index);
24
+ // Note: there’s no need to special-case astral symbols, surrogate
25
+ // pairs, or lone surrogates.
26
+ // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
27
+ // (U+FFFD).
28
+ if (codeUnit == 0x0000) {
29
+ result += '\uFFFD';
30
+ continue;
31
+ }
32
+ if (// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
33
+ // U+007F, […]
34
+ codeUnit >= 0x0001 && codeUnit <= 0x001F || codeUnit == 0x007F || // If the character is the first character and is in the range [0-9]
35
+ // (U+0030 to U+0039), […]
36
+ index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039 || // If the character is the second character and is in the range [0-9]
37
+ // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
38
+ index == 1 && codeUnit >= 0x0030 && codeUnit <= 0x0039 && firstCodeUnit == 0x002D) {
39
+ // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
40
+ result += '\\' + codeUnit.toString(16) + ' ';
41
+ continue;
42
+ }
43
+ // If the character is not handled by one of the above rules and is
44
+ // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
45
+ // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
46
+ // U+005A), or [a-z] (U+0061 to U+007A), […]
47
+ if (codeUnit >= 0x0080 || codeUnit == 0x002D || codeUnit == 0x005F || codeUnit >= 0x0030 && codeUnit <= 0x0039 || codeUnit >= 0x0041 && codeUnit <= 0x005A || codeUnit >= 0x0061 && codeUnit <= 0x007A) {
48
+ // the character itself
49
+ result += string.charAt(index);
50
+ continue;
51
+ }
52
+ // Otherwise, the escaped character.
53
+ // https://drafts.csswg.org/cssom/#escape-a-character
54
+ result += '\\' + string.charAt(index);
55
+ }
56
+ return result;
57
+ };
58
+ if (!root.CSS) {
59
+ root.CSS = {};
60
+ }
61
+ root.CSS.escape = cssEscape;
62
+ globalThis.CSS.escape = cssEscape;
63
+ }
64
+ })();