@master/css 2.0.0-rc.61 → 2.0.0-rc.62

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 (125) hide show
  1. package/dist/animation-rule.cjs +24 -0
  2. package/dist/animation-rule.d.ts +11 -0
  3. package/dist/animation-rule.mjs +22 -0
  4. package/dist/common.cjs +50 -1
  5. package/dist/common.d.ts +14 -0
  6. package/dist/common.mjs +45 -2
  7. package/dist/config/at.cjs +13 -10
  8. package/dist/config/at.d.ts +4 -1
  9. package/dist/config/at.mjs +13 -10
  10. package/dist/config/index.cjs +3 -0
  11. package/dist/config/index.d.ts +2 -1
  12. package/dist/config/index.mjs +3 -1
  13. package/dist/config/modes.d.ts +4 -2
  14. package/dist/config/rules.cjs +25 -13
  15. package/dist/config/rules.d.ts +4 -2
  16. package/dist/config/rules.mjs +25 -13
  17. package/dist/config/screens.cjs +17 -0
  18. package/dist/config/screens.d.ts +14 -0
  19. package/dist/config/screens.mjs +15 -0
  20. package/dist/config/selectors.cjs +11 -15
  21. package/dist/config/selectors.d.ts +10 -8
  22. package/dist/config/selectors.mjs +11 -15
  23. package/dist/config/utilities.cjs +3 -0
  24. package/dist/config/utilities.d.ts +3 -0
  25. package/dist/config/utilities.mjs +3 -0
  26. package/dist/config/variables.cjs +0 -13
  27. package/dist/config/variables.d.ts +0 -13
  28. package/dist/config/variables.mjs +0 -13
  29. package/dist/core.cjs +438 -476
  30. package/dist/core.d.ts +13 -4
  31. package/dist/core.mjs +438 -476
  32. package/dist/factories/with-syntax-layer.cjs +37 -260
  33. package/dist/factories/with-syntax-layer.mjs +37 -260
  34. package/dist/index.cjs +38 -12
  35. package/dist/index.d.ts +19 -7
  36. package/dist/index.mjs +17 -7
  37. package/dist/layer.cjs +11 -7
  38. package/dist/layer.d.ts +4 -3
  39. package/dist/layer.mjs +11 -7
  40. package/dist/non-layer.cjs +10 -17
  41. package/dist/non-layer.d.ts +1 -1
  42. package/dist/non-layer.mjs +10 -17
  43. package/dist/rule.cjs +4 -6
  44. package/dist/rule.d.ts +3 -10
  45. package/dist/rule.mjs +4 -6
  46. package/dist/syntax-rule-type.cjs +7 -8
  47. package/dist/syntax-rule-type.d.ts +7 -7
  48. package/dist/syntax-rule-type.mjs +7 -8
  49. package/dist/syntax-rule.cjs +116 -328
  50. package/dist/syntax-rule.d.ts +18 -25
  51. package/dist/syntax-rule.mjs +117 -329
  52. package/dist/types/common.d.ts +2 -0
  53. package/dist/types/config.d.ts +12 -7
  54. package/dist/types/syntax.d.ts +5 -24
  55. package/dist/utils/compare-rule-priority.cjs +143 -0
  56. package/dist/utils/compare-rule-priority.d.ts +7 -0
  57. package/dist/utils/compare-rule-priority.mjs +138 -0
  58. package/dist/utils/equal-at-rules.cjs +22 -0
  59. package/dist/utils/equal-at-rules.d.ts +2 -0
  60. package/dist/utils/equal-at-rules.mjs +20 -0
  61. package/dist/utils/equal-declarations.cjs +10 -0
  62. package/dist/utils/equal-declarations.d.ts +2 -0
  63. package/dist/utils/equal-declarations.mjs +8 -0
  64. package/dist/utils/equal-selectors.cjs +70 -0
  65. package/dist/utils/equal-selectors.d.ts +2 -0
  66. package/dist/utils/equal-selectors.mjs +68 -0
  67. package/dist/utils/equal-variants.cjs +10 -0
  68. package/dist/utils/equal-variants.d.ts +2 -0
  69. package/dist/utils/equal-variants.mjs +8 -0
  70. package/dist/utils/extend-config.cjs +0 -1
  71. package/dist/utils/extend-config.mjs +0 -1
  72. package/dist/utils/generate-at.cjs +30 -0
  73. package/dist/utils/generate-at.d.ts +2 -0
  74. package/dist/utils/generate-at.mjs +28 -0
  75. package/dist/utils/generate-selector.cjs +49 -0
  76. package/dist/utils/generate-selector.d.ts +2 -0
  77. package/dist/utils/generate-selector.mjs +47 -0
  78. package/dist/utils/get-single-at-number-rule-node.cjs +9 -0
  79. package/dist/utils/get-single-at-number-rule-node.d.ts +2 -0
  80. package/dist/utils/get-single-at-number-rule-node.mjs +7 -0
  81. package/dist/utils/parse-at.cjs +157 -0
  82. package/dist/utils/parse-at.d.ts +39 -0
  83. package/dist/utils/parse-at.mjs +155 -0
  84. package/dist/utils/parse-pair.cjs +51 -0
  85. package/dist/utils/parse-pair.d.ts +8 -0
  86. package/dist/utils/parse-pair.mjs +49 -0
  87. package/dist/utils/parse-selector.cjs +112 -0
  88. package/dist/utils/parse-selector.d.ts +19 -0
  89. package/dist/utils/parse-selector.mjs +110 -0
  90. package/dist/utils/parse-value.cjs +39 -0
  91. package/dist/utils/parse-value.d.ts +2 -0
  92. package/dist/utils/parse-value.mjs +37 -0
  93. package/dist/utils/replace-char-outside-quotes.cjs +21 -0
  94. package/dist/utils/replace-char-outside-quotes.d.ts +1 -0
  95. package/dist/utils/replace-char-outside-quotes.mjs +19 -0
  96. package/dist/utils/sort-readable-classes.cjs +74 -0
  97. package/dist/utils/{reorder-for-readable-classes.d.ts → sort-readable-classes.d.ts} +1 -1
  98. package/dist/utils/sort-readable-classes.mjs +72 -0
  99. package/dist/utils/split-char-outside-quotes.cjs +29 -0
  100. package/dist/utils/split-char-outside-quotes.d.ts +1 -0
  101. package/dist/utils/split-char-outside-quotes.mjs +27 -0
  102. package/dist/variable-rule.cjs +86 -0
  103. package/dist/variable-rule.d.ts +23 -0
  104. package/dist/variable-rule.mjs +81 -0
  105. package/package.json +1 -1
  106. package/dist/rule-node.cjs +0 -18
  107. package/dist/rule-node.d.ts +0 -14
  108. package/dist/rule-node.mjs +0 -16
  109. package/dist/utils/are-rule-at-equal.cjs +0 -12
  110. package/dist/utils/are-rule-at-equal.d.ts +0 -2
  111. package/dist/utils/are-rule-at-equal.mjs +0 -10
  112. package/dist/utils/are-rule-modes-equal.cjs +0 -7
  113. package/dist/utils/are-rule-modes-equal.d.ts +0 -2
  114. package/dist/utils/are-rule-modes-equal.mjs +0 -5
  115. package/dist/utils/are-rule-selectors-equal.cjs +0 -29
  116. package/dist/utils/are-rule-selectors-equal.d.ts +0 -2
  117. package/dist/utils/are-rule-selectors-equal.mjs +0 -27
  118. package/dist/utils/are-rule-states-equal.cjs +0 -11
  119. package/dist/utils/are-rule-states-equal.d.ts +0 -2
  120. package/dist/utils/are-rule-states-equal.mjs +0 -9
  121. package/dist/utils/are-rules-duplicated.cjs +0 -17
  122. package/dist/utils/are-rules-duplicated.d.ts +0 -2
  123. package/dist/utils/are-rules-duplicated.mjs +0 -15
  124. package/dist/utils/reorder-for-readable-classes.cjs +0 -62
  125. package/dist/utils/reorder-for-readable-classes.mjs +0 -60
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ class AnimationRule {
4
+ name;
5
+ keyframes;
6
+ css;
7
+ native;
8
+ constructor(name, keyframes, css){
9
+ this.name = name;
10
+ this.keyframes = keyframes;
11
+ this.css = css;
12
+ }
13
+ get key() {
14
+ return this.name;
15
+ }
16
+ get text() {
17
+ return `@keyframes ${this.name}{` + Object.entries(this.keyframes).reduce((acc, [key, variables])=>{
18
+ const variableText = Object.entries(variables).map(([name, value])=>`${name}:${value}`).join(';');
19
+ return acc + `${key}{${variableText}}`;
20
+ }, '') + '}';
21
+ }
22
+ }
23
+
24
+ module.exports = AnimationRule;
@@ -0,0 +1,11 @@
1
+ import MasterCSS from './core';
2
+ import { AnimationDefinitions } from './types/config';
3
+ export default class AnimationRule {
4
+ readonly name: string;
5
+ readonly keyframes: AnimationDefinitions;
6
+ readonly css: MasterCSS;
7
+ native?: CSSKeyframeRule;
8
+ constructor(name: string, keyframes: AnimationDefinitions, css: MasterCSS);
9
+ get key(): string;
10
+ get text(): string;
11
+ }
@@ -0,0 +1,22 @@
1
+ class AnimationRule {
2
+ name;
3
+ keyframes;
4
+ css;
5
+ native;
6
+ constructor(name, keyframes, css){
7
+ this.name = name;
8
+ this.keyframes = keyframes;
9
+ this.css = css;
10
+ }
11
+ get key() {
12
+ return this.name;
13
+ }
14
+ get text() {
15
+ return `@keyframes ${this.name}{` + Object.entries(this.keyframes).reduce((acc, [key, variables])=>{
16
+ const variableText = Object.entries(variables).map(([name, value])=>`${name}:${value}`).join(';');
17
+ return acc + `${key}{${variableText}}`;
18
+ }, '') + '}';
19
+ }
20
+ }
21
+
22
+ export { AnimationRule as default };
package/dist/common.cjs CHANGED
@@ -17,6 +17,12 @@ const SELECTOR_SIGNS = [
17
17
  '+',
18
18
  '~'
19
19
  ];
20
+ const SELECTOR_COMBINATORS = [
21
+ '_',
22
+ '>',
23
+ '+',
24
+ '~'
25
+ ];
20
26
  const QUERY_COMPARISON_OPERATORS = [
21
27
  '>',
22
28
  '<',
@@ -99,7 +105,7 @@ const VALUE_UNITS = [
99
105
  'db',
100
106
  'st'
101
107
  ];
102
- const UNIT_REGEX = /^([+-.]?\d+(\.?\d+)?)(%|cm|mm|q|in|pt|pc|px|em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cqw|cqh|cqi|cqb|cqmin|cqmax|deg|grad|rad|turn|s|ms|hz|khz|dpi|dpcm|dppx|x|fr|db|st)?$/;
108
+ const UNIT_REGEX = /^([+-.]?\d+(?:\.?\d+)?)(%|cm|mm|q|in|pt|pc|px|em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cqw|cqh|cqi|cqb|cqmin|cqmax|deg|grad|rad|turn|s|ms|hz|khz|dpi|dpcm|dppx|x|fr|db|st)?$/;
103
109
  const IMAGE_VALUE_REGEX = /(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\(.*\)/;
104
110
  const COLOR_VALUE_REGEX = /(?:#|(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla|light-dark)\(.*\)|(?:\$colors)(?![a-zA-Z0-9-]))/;
105
111
  const NUMBER_VALUE_REGEX = /(?:[\d.]|(?:max|min|calc|clamp)\([^|]*\))/;
@@ -135,8 +141,49 @@ const BORDER_STYLE_VALUES = [
135
141
  'inset',
136
142
  'outset'
137
143
  ];
144
+ const AT_COMPARISON_OPERATORS = [
145
+ '>=',
146
+ '<=',
147
+ '>',
148
+ '<',
149
+ '='
150
+ ];
151
+ const AT_LOGICAL_OPERATORS = {
152
+ '&': 'and',
153
+ '!': 'not',
154
+ // native
155
+ 'not': 'not',
156
+ 'and': 'and',
157
+ 'or': 'or',
158
+ 'only': 'only',
159
+ ',': 'or'
160
+ };
161
+ // the order is intentional and should not be changed
162
+ const AT_IDENTIFIERS = [
163
+ 'container',
164
+ 'starting-style',
165
+ 'supports',
166
+ 'media',
167
+ 'layer'
168
+ ];
169
+ const COMPARISION_OPERATORS = [
170
+ '>=',
171
+ '<=',
172
+ '>',
173
+ '<',
174
+ '='
175
+ ];
176
+ const AT_COMPARABLE_FEATURES = [
177
+ 'width',
178
+ 'height',
179
+ 'resolution'
180
+ ];
138
181
 
139
182
  exports.ANIMATION_SIGN = ANIMATION_SIGN;
183
+ exports.AT_COMPARABLE_FEATURES = AT_COMPARABLE_FEATURES;
184
+ exports.AT_COMPARISON_OPERATORS = AT_COMPARISON_OPERATORS;
185
+ exports.AT_IDENTIFIERS = AT_IDENTIFIERS;
186
+ exports.AT_LOGICAL_OPERATORS = AT_LOGICAL_OPERATORS;
140
187
  exports.AT_SIGN = AT_SIGN;
141
188
  exports.BASE_UNIT_REGEX = BASE_UNIT_REGEX;
142
189
  exports.BORDER_STYLE_VALUES = BORDER_STYLE_VALUES;
@@ -144,12 +191,14 @@ exports.CLASS_ATTRIBUTES = CLASS_ATTRIBUTES;
144
191
  exports.CLASS_DECLARATIONS = CLASS_DECLARATIONS;
145
192
  exports.CLASS_FUNCTIONS = CLASS_FUNCTIONS;
146
193
  exports.COLOR_VALUE_REGEX = COLOR_VALUE_REGEX;
194
+ exports.COMPARISION_OPERATORS = COMPARISION_OPERATORS;
147
195
  exports.DELIMITER_SIGN = DELIMITER_SIGN;
148
196
  exports.IMAGE_VALUE_REGEX = IMAGE_VALUE_REGEX;
149
197
  exports.NUMBER_VALUE_REGEX = NUMBER_VALUE_REGEX;
150
198
  exports.OFFICIAL_URL = OFFICIAL_URL;
151
199
  exports.QUERY_COMPARISON_OPERATORS = QUERY_COMPARISON_OPERATORS;
152
200
  exports.QUERY_LOGICAL_OPERATORS = QUERY_LOGICAL_OPERATORS;
201
+ exports.SELECTOR_COMBINATORS = SELECTOR_COMBINATORS;
153
202
  exports.SELECTOR_SIGNS = SELECTOR_SIGNS;
154
203
  exports.SEPARATOR_SIGN = SEPARATOR_SIGN;
155
204
  exports.SEPARATOR_SIGNS = SEPARATOR_SIGNS;
package/dist/common.d.ts CHANGED
@@ -8,6 +8,7 @@ export declare const BASE_UNIT_REGEX: RegExp;
8
8
  export declare const TRANSITION_SIGN = "~";
9
9
  export declare const ANIMATION_SIGN = "@";
10
10
  export declare const SELECTOR_SIGNS: string[];
11
+ export declare const SELECTOR_COMBINATORS: string[];
11
12
  export declare const QUERY_COMPARISON_OPERATORS: string[];
12
13
  export declare const QUERY_LOGICAL_OPERATORS: string[];
13
14
  export declare const SEPARATOR_SIGNS: string[];
@@ -24,3 +25,16 @@ export declare const CLASS_ATTRIBUTES: string[];
24
25
  export declare const CLASS_DECLARATIONS: string[];
25
26
  export declare const CLASS_FUNCTIONS: string[];
26
27
  export declare const BORDER_STYLE_VALUES: string[];
28
+ export declare const AT_COMPARISON_OPERATORS: string[];
29
+ export declare const AT_LOGICAL_OPERATORS: {
30
+ '&': string;
31
+ '!': string;
32
+ not: string;
33
+ and: string;
34
+ or: string;
35
+ only: string;
36
+ ',': string;
37
+ };
38
+ export declare const AT_IDENTIFIERS: string[];
39
+ export declare const COMPARISION_OPERATORS: string[];
40
+ export declare const AT_COMPARABLE_FEATURES: string[];
package/dist/common.mjs CHANGED
@@ -15,6 +15,12 @@ const SELECTOR_SIGNS = [
15
15
  '+',
16
16
  '~'
17
17
  ];
18
+ const SELECTOR_COMBINATORS = [
19
+ '_',
20
+ '>',
21
+ '+',
22
+ '~'
23
+ ];
18
24
  const QUERY_COMPARISON_OPERATORS = [
19
25
  '>',
20
26
  '<',
@@ -97,7 +103,7 @@ const VALUE_UNITS = [
97
103
  'db',
98
104
  'st'
99
105
  ];
100
- const UNIT_REGEX = /^([+-.]?\d+(\.?\d+)?)(%|cm|mm|q|in|pt|pc|px|em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cqw|cqh|cqi|cqb|cqmin|cqmax|deg|grad|rad|turn|s|ms|hz|khz|dpi|dpcm|dppx|x|fr|db|st)?$/;
106
+ const UNIT_REGEX = /^([+-.]?\d+(?:\.?\d+)?)(%|cm|mm|q|in|pt|pc|px|em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cqw|cqh|cqi|cqb|cqmin|cqmax|deg|grad|rad|turn|s|ms|hz|khz|dpi|dpcm|dppx|x|fr|db|st)?$/;
101
107
  const IMAGE_VALUE_REGEX = /(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\(.*\)/;
102
108
  const COLOR_VALUE_REGEX = /(?:#|(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla|light-dark)\(.*\)|(?:\$colors)(?![a-zA-Z0-9-]))/;
103
109
  const NUMBER_VALUE_REGEX = /(?:[\d.]|(?:max|min|calc|clamp)\([^|]*\))/;
@@ -133,5 +139,42 @@ const BORDER_STYLE_VALUES = [
133
139
  'inset',
134
140
  'outset'
135
141
  ];
142
+ const AT_COMPARISON_OPERATORS = [
143
+ '>=',
144
+ '<=',
145
+ '>',
146
+ '<',
147
+ '='
148
+ ];
149
+ const AT_LOGICAL_OPERATORS = {
150
+ '&': 'and',
151
+ '!': 'not',
152
+ // native
153
+ 'not': 'not',
154
+ 'and': 'and',
155
+ 'or': 'or',
156
+ 'only': 'only',
157
+ ',': 'or'
158
+ };
159
+ // the order is intentional and should not be changed
160
+ const AT_IDENTIFIERS = [
161
+ 'container',
162
+ 'starting-style',
163
+ 'supports',
164
+ 'media',
165
+ 'layer'
166
+ ];
167
+ const COMPARISION_OPERATORS = [
168
+ '>=',
169
+ '<=',
170
+ '>',
171
+ '<',
172
+ '='
173
+ ];
174
+ const AT_COMPARABLE_FEATURES = [
175
+ 'width',
176
+ 'height',
177
+ 'resolution'
178
+ ];
136
179
 
137
- export { ANIMATION_SIGN, AT_SIGN, BASE_UNIT_REGEX, BORDER_STYLE_VALUES, 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 };
180
+ export { ANIMATION_SIGN, AT_COMPARABLE_FEATURES, AT_COMPARISON_OPERATORS, AT_IDENTIFIERS, AT_LOGICAL_OPERATORS, AT_SIGN, BASE_UNIT_REGEX, BORDER_STYLE_VALUES, CLASS_ATTRIBUTES, CLASS_DECLARATIONS, CLASS_FUNCTIONS, COLOR_VALUE_REGEX, COMPARISION_OPERATORS, DELIMITER_SIGN, IMAGE_VALUE_REGEX, NUMBER_VALUE_REGEX, OFFICIAL_URL, QUERY_COMPARISON_OPERATORS, QUERY_LOGICAL_OPERATORS, SELECTOR_COMBINATORS, SELECTOR_SIGNS, SEPARATOR_SIGN, SEPARATOR_SIGNS, TRANSITION_SIGN, UNIT_REGEX, VALUE_DELIMITERS, VALUE_UNITS };
@@ -1,16 +1,19 @@
1
1
  'use strict';
2
2
 
3
3
  const at = {
4
- all: 'media all',
5
- print: 'media print',
6
- screen: 'media screen',
7
- speech: 'media speech',
8
- landscape: 'media (orientation:landscape)',
9
- portrait: 'media (orientation:portrait)',
10
- motion: 'media (prefers-reduced-motion:no-preference)',
11
- 'reduced-motion': 'media (prefers-reduced-motion:reduce)',
12
- base: 'layer base',
13
- preset: 'layer preset'
4
+ all: 'media(all)',
5
+ print: 'media(print)',
6
+ screen: 'media(screen)',
7
+ speech: 'media(speech)',
8
+ landscape: 'media(orientation:landscape)',
9
+ portrait: 'media(orientation:portrait)',
10
+ motion: 'media(prefers-reduced-motion:no-preference)',
11
+ 'reduce-motion': 'media(prefers-reduced-motion:reduce)',
12
+ base: 'layer(base)',
13
+ preset: 'layer(preset)',
14
+ start: 'starting-style',
15
+ w: 'width',
16
+ h: 'height'
14
17
  };
15
18
 
16
19
  module.exports = at;
@@ -6,8 +6,11 @@ declare const at: {
6
6
  landscape: string;
7
7
  portrait: string;
8
8
  motion: string;
9
- 'reduced-motion': string;
9
+ 'reduce-motion': string;
10
10
  base: string;
11
11
  preset: string;
12
+ start: string;
13
+ w: string;
14
+ h: string;
12
15
  };
13
16
  export default at;
@@ -1,14 +1,17 @@
1
1
  const at = {
2
- all: 'media all',
3
- print: 'media print',
4
- screen: 'media screen',
5
- speech: 'media speech',
6
- landscape: 'media (orientation:landscape)',
7
- portrait: 'media (orientation:portrait)',
8
- motion: 'media (prefers-reduced-motion:no-preference)',
9
- 'reduced-motion': 'media (prefers-reduced-motion:reduce)',
10
- base: 'layer base',
11
- preset: 'layer preset'
2
+ all: 'media(all)',
3
+ print: 'media(print)',
4
+ screen: 'media(screen)',
5
+ speech: 'media(speech)',
6
+ landscape: 'media(orientation:landscape)',
7
+ portrait: 'media(orientation:portrait)',
8
+ motion: 'media(prefers-reduced-motion:no-preference)',
9
+ 'reduce-motion': 'media(prefers-reduced-motion:reduce)',
10
+ base: 'layer(base)',
11
+ preset: 'layer(preset)',
12
+ start: 'starting-style',
13
+ w: 'width',
14
+ h: 'height'
12
15
  };
13
16
 
14
17
  export { at as default };
@@ -8,6 +8,7 @@ var variables = require('./variables.cjs');
8
8
  var rules = require('./rules.cjs');
9
9
  var modes = require('./modes.cjs');
10
10
  var functions = require('./functions.cjs');
11
+ var screens = require('./screens.cjs');
11
12
 
12
13
  const config = {
13
14
  at,
@@ -18,6 +19,7 @@ const config = {
18
19
  animations,
19
20
  variables,
20
21
  modes,
22
+ screens,
21
23
  scope: '',
22
24
  rootSize: 16,
23
25
  baseUnit: 4,
@@ -34,4 +36,5 @@ exports.variables = variables;
34
36
  exports.rules = rules;
35
37
  exports.modes = modes;
36
38
  exports.functions = functions;
39
+ exports.screens = screens;
37
40
  exports.config = config;
@@ -6,6 +6,7 @@ import variables from './variables';
6
6
  import rules from './rules';
7
7
  import modes from './modes';
8
8
  import functions from './functions';
9
+ import screens from './screens';
9
10
  import { Config } from '../types/config';
10
11
  declare const config: Config;
11
- export { config, at, selectors, utilities, rules, functions, animations, variables, modes };
12
+ export { config, at, selectors, utilities, rules, functions, animations, variables, modes, screens };
@@ -6,6 +6,7 @@ import variables from './variables.mjs';
6
6
  import rules from './rules.mjs';
7
7
  import modes from './modes.mjs';
8
8
  import functions from './functions.mjs';
9
+ import screens from './screens.mjs';
9
10
 
10
11
  const config = {
11
12
  at,
@@ -16,6 +17,7 @@ const config = {
16
17
  animations,
17
18
  variables,
18
19
  modes,
20
+ screens,
19
21
  scope: '',
20
22
  rootSize: 16,
21
23
  baseUnit: 4,
@@ -24,4 +26,4 @@ const config = {
24
26
  defaultMode: 'light'
25
27
  };
26
28
 
27
- export { animations, at, config, functions, modes, rules, selectors, utilities, variables };
29
+ export { animations, at, config, functions, modes, rules, screens, selectors, utilities, variables };
@@ -1,3 +1,5 @@
1
- import { ModeDefinitions } from '../types/config';
2
- declare const modes: ModeDefinitions;
1
+ declare const modes: {
2
+ dark: "class";
3
+ light: "class";
4
+ };
3
5
  export default modes;
@@ -37,29 +37,24 @@ const rules = {
37
37
  addProp(eachCssProperty);
38
38
  }
39
39
  };
40
- for (const eachNative of rule.nodes){
41
- addProps(eachNative.text);
42
- }
40
+ addProps(rule.text);
43
41
  // animation
44
42
  if (rule.animationNames) {
45
43
  if (!this.animationNames) {
46
- this.animationNames = [];
44
+ this.animationNames = new Set();
47
45
  }
48
46
  for (const eachKeyframeName of rule.animationNames){
49
- if (!this.animationNames.includes(eachKeyframeName)) {
50
- this.animationNames.push(eachKeyframeName);
51
- }
47
+ this.animationNames.add(eachKeyframeName);
52
48
  }
53
49
  }
54
50
  // variable
55
51
  if (rule.variableNames) {
56
- if (!this.variableNames) {
57
- this.variableNames = [];
58
- }
59
- for (const eachVariableName of rule.variableNames){
60
- if (!this.variableNames.includes(eachVariableName)) {
61
- this.variableNames.push(eachVariableName);
52
+ if (this.variableNames) {
53
+ for (const eachVariableName of rule.variableNames){
54
+ this.variableNames.add(eachVariableName);
62
55
  }
56
+ } else {
57
+ this.variableNames = new Set(rule.variableNames);
63
58
  }
64
59
  }
65
60
  };
@@ -551,6 +546,23 @@ const rules = {
551
546
  };
552
547
  }
553
548
  },
549
+ container: {
550
+ type: syntaxRuleType.NativeShorthand
551
+ },
552
+ 'container-name': {
553
+ type: syntaxRuleType.Native
554
+ },
555
+ 'container-type': {
556
+ type: syntaxRuleType.Native,
557
+ ambiguousKeys: [
558
+ 'container'
559
+ ],
560
+ ambiguousValues: [
561
+ 'size',
562
+ 'inline-size',
563
+ 'scroll-state'
564
+ ]
565
+ },
554
566
  contain: {
555
567
  type: syntaxRuleType.Native
556
568
  },
@@ -1,4 +1,3 @@
1
- import SyntaxRuleType from '../syntax-rule-type';
2
1
  import { SyntaxRuleDefinition } from '../types/config';
3
2
  declare const rules: {
4
3
  group: SyntaxRuleDefinition;
@@ -11,7 +10,7 @@ declare const rules: {
11
10
  'font-variant-numeric': SyntaxRuleDefinition;
12
11
  'font-variant': {
13
12
  ambiguousKeys: string[];
14
- type: SyntaxRuleType;
13
+ type: -3;
15
14
  };
16
15
  font: SyntaxRuleDefinition;
17
16
  'font-feature-settings': SyntaxRuleDefinition;
@@ -52,6 +51,9 @@ declare const rules: {
52
51
  'max-size': SyntaxRuleDefinition;
53
52
  'box-sizing': SyntaxRuleDefinition;
54
53
  'box-decoration-break': SyntaxRuleDefinition;
54
+ container: SyntaxRuleDefinition;
55
+ 'container-name': SyntaxRuleDefinition;
56
+ 'container-type': SyntaxRuleDefinition;
55
57
  contain: SyntaxRuleDefinition;
56
58
  content: SyntaxRuleDefinition;
57
59
  'counter-increment': SyntaxRuleDefinition;
@@ -35,29 +35,24 @@ const rules = {
35
35
  addProp(eachCssProperty);
36
36
  }
37
37
  };
38
- for (const eachNative of rule.nodes){
39
- addProps(eachNative.text);
40
- }
38
+ addProps(rule.text);
41
39
  // animation
42
40
  if (rule.animationNames) {
43
41
  if (!this.animationNames) {
44
- this.animationNames = [];
42
+ this.animationNames = new Set();
45
43
  }
46
44
  for (const eachKeyframeName of rule.animationNames){
47
- if (!this.animationNames.includes(eachKeyframeName)) {
48
- this.animationNames.push(eachKeyframeName);
49
- }
45
+ this.animationNames.add(eachKeyframeName);
50
46
  }
51
47
  }
52
48
  // variable
53
49
  if (rule.variableNames) {
54
- if (!this.variableNames) {
55
- this.variableNames = [];
56
- }
57
- for (const eachVariableName of rule.variableNames){
58
- if (!this.variableNames.includes(eachVariableName)) {
59
- this.variableNames.push(eachVariableName);
50
+ if (this.variableNames) {
51
+ for (const eachVariableName of rule.variableNames){
52
+ this.variableNames.add(eachVariableName);
60
53
  }
54
+ } else {
55
+ this.variableNames = new Set(rule.variableNames);
61
56
  }
62
57
  }
63
58
  };
@@ -549,6 +544,23 @@ const rules = {
549
544
  };
550
545
  }
551
546
  },
547
+ container: {
548
+ type: SyntaxRuleType.NativeShorthand
549
+ },
550
+ 'container-name': {
551
+ type: SyntaxRuleType.Native
552
+ },
553
+ 'container-type': {
554
+ type: SyntaxRuleType.Native,
555
+ ambiguousKeys: [
556
+ 'container'
557
+ ],
558
+ ambiguousValues: [
559
+ 'size',
560
+ 'inline-size',
561
+ 'scroll-state'
562
+ ]
563
+ },
552
564
  contain: {
553
565
  type: SyntaxRuleType.Native
554
566
  },
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ const screens = {
4
+ '4xs': 360,
5
+ '3xs': 480,
6
+ '2xs': 600,
7
+ 'xs': 768,
8
+ 'sm': 834,
9
+ 'md': 1024,
10
+ 'lg': 1280,
11
+ 'xl': 1440,
12
+ '2xl': 1600,
13
+ '3xl': 1920,
14
+ '4xl': 2560
15
+ };
16
+
17
+ module.exports = screens;
@@ -0,0 +1,14 @@
1
+ declare const screens: {
2
+ '4xs': number;
3
+ '3xs': number;
4
+ '2xs': number;
5
+ xs: number;
6
+ sm: number;
7
+ md: number;
8
+ lg: number;
9
+ xl: number;
10
+ '2xl': number;
11
+ '3xl': number;
12
+ '4xl': number;
13
+ };
14
+ export default screens;
@@ -0,0 +1,15 @@
1
+ const screens = {
2
+ '4xs': 360,
3
+ '3xs': 480,
4
+ '2xs': 600,
5
+ 'xs': 768,
6
+ 'sm': 834,
7
+ 'md': 1024,
8
+ 'lg': 1280,
9
+ 'xl': 1440,
10
+ '2xl': 1600,
11
+ '3xl': 1920,
12
+ '4xl': 2560
13
+ };
14
+
15
+ export { screens as default };
@@ -1,28 +1,24 @@
1
1
  'use strict';
2
2
 
3
3
  const selectors = {
4
+ ':first': ':first-child',
5
+ ':last': ':last-child',
6
+ ':even': ':nth-child(2n)',
7
+ ':odd': ':nth-child(odd)',
8
+ ':nth': ':nth-child',
9
+ ':only': ':only-child',
10
+ ':rtl': ':dir(rtl)',
11
+ ':ltr': ':dir(ltr)',
4
12
  '::scrollbar': '::-webkit-scrollbar',
5
13
  '::scrollbar-button': '::-webkit-scrollbar-button',
6
14
  '::scrollbar-thumb': '::-webkit-scrollbar-thumb',
7
15
  '::scrollbar-track': '::-webkit-scrollbar-track',
8
16
  '::scrollbar-track-piece': '::-webkit-scrollbar-track-piece',
9
17
  '::scrollbar-corner': '::-webkit-scrollbar-corner',
10
- '::slider-thumb': [
11
- '::-webkit-slider-thumb',
12
- '::-moz-range-thumb'
13
- ],
14
- '::slider-runnable-track': [
15
- '::-webkit-slider-runnable-track',
16
- '::-moz-range-track'
17
- ],
18
+ '::slider-thumb': '::-webkit-slider-thumb',
19
+ '::slider-runnable-track': '::-webkit-slider-runnable-track',
18
20
  '::resizer': '::-webkit-resizer',
19
- '::progress': '::-webkit-progress',
20
- ':first': ':first-child',
21
- ':last': ':last-child',
22
- ':even': ':nth-child(2n)',
23
- ':odd': ':nth-child(odd)',
24
- ':nth(': ':nth-child(',
25
- ':only': ':only-child'
21
+ '::progress': '::-webkit-progress'
26
22
  };
27
23
 
28
24
  module.exports = selectors;
@@ -1,19 +1,21 @@
1
1
  declare const selectors: {
2
+ ':first': string;
3
+ ':last': string;
4
+ ':even': string;
5
+ ':odd': string;
6
+ ':nth': string;
7
+ ':only': string;
8
+ ':rtl': string;
9
+ ':ltr': string;
2
10
  '::scrollbar': string;
3
11
  '::scrollbar-button': string;
4
12
  '::scrollbar-thumb': string;
5
13
  '::scrollbar-track': string;
6
14
  '::scrollbar-track-piece': string;
7
15
  '::scrollbar-corner': string;
8
- '::slider-thumb': string[];
9
- '::slider-runnable-track': string[];
16
+ '::slider-thumb': string;
17
+ '::slider-runnable-track': string;
10
18
  '::resizer': string;
11
19
  '::progress': string;
12
- ':first': string;
13
- ':last': string;
14
- ':even': string;
15
- ':odd': string;
16
- ':nth(': string;
17
- ':only': string;
18
20
  };
19
21
  export default selectors;