@master/css 2.0.0-rc.39 → 2.0.0-rc.40

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.
@@ -1,8 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var screenSizes = require('../tokens/screen-sizes.cjs');
4
-
5
- const queries = {
3
+ const at = {
6
4
  all: 'media all',
7
5
  print: 'media print',
8
6
  screen: 'media screen',
@@ -10,8 +8,7 @@ const queries = {
10
8
  landscape: 'media (orientation:landscape)',
11
9
  portrait: 'media (orientation:portrait)',
12
10
  motion: 'media (prefers-reduced-motion:no-preference)',
13
- 'reduced-motion': 'media (prefers-reduced-motion:reduce)',
14
- ...screenSizes
11
+ 'reduced-motion': 'media (prefers-reduced-motion:reduce)'
15
12
  };
16
13
 
17
- module.exports = queries;
14
+ module.exports = at;
@@ -0,0 +1,11 @@
1
+ declare const at: {
2
+ all: string;
3
+ print: string;
4
+ screen: string;
5
+ speech: string;
6
+ landscape: string;
7
+ portrait: string;
8
+ motion: string;
9
+ 'reduced-motion': string;
10
+ };
11
+ export default at;
@@ -1,6 +1,4 @@
1
- import screenSizes from '../tokens/screen-sizes.mjs';
2
-
3
- const queries = {
1
+ const at = {
4
2
  all: 'media all',
5
3
  print: 'media print',
6
4
  screen: 'media screen',
@@ -8,8 +6,7 @@ const queries = {
8
6
  landscape: 'media (orientation:landscape)',
9
7
  portrait: 'media (orientation:portrait)',
10
8
  motion: 'media (prefers-reduced-motion:no-preference)',
11
- 'reduced-motion': 'media (prefers-reduced-motion:reduce)',
12
- ...screenSizes
9
+ 'reduced-motion': 'media (prefers-reduced-motion:reduce)'
13
10
  };
14
11
 
15
- export { queries as default };
12
+ export { at as default };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var queries = require('./queries.cjs');
3
+ var at = require('./at.cjs');
4
4
  var selectors = require('./selectors.cjs');
5
5
  var utilities = require('./utilities.cjs');
6
6
  var animations = require('./animations.cjs');
@@ -10,7 +10,7 @@ var modes = require('./modes.cjs');
10
10
  var functions = require('./functions.cjs');
11
11
 
12
12
  const config = {
13
- queries,
13
+ at,
14
14
  selectors,
15
15
  utilities,
16
16
  rules,
@@ -25,7 +25,7 @@ const config = {
25
25
  important: false
26
26
  };
27
27
 
28
- exports.queries = queries;
28
+ exports.at = at;
29
29
  exports.selectors = selectors;
30
30
  exports.utilities = utilities;
31
31
  exports.animations = animations;
@@ -1,4 +1,4 @@
1
- import queries from './queries';
1
+ import at from './at';
2
2
  import selectors from './selectors';
3
3
  import utilities from './utilities';
4
4
  import animations from './animations';
@@ -9,7 +9,7 @@ import functions from './functions';
9
9
  import type { PropertiesHyphen } from 'csstype';
10
10
  import type { Rule, RuleDefinition, ValueComponent } from '../rule';
11
11
  declare const config: Config;
12
- export { config, queries, selectors, utilities, rules, functions, animations, variables, modes };
12
+ export { config, at, selectors, utilities, rules, functions, animations, variables, modes };
13
13
  export type VariableValue = number | string | Array<number | string>;
14
14
  export type VariableDefinition = {
15
15
  [key in '' | `@${string}` | string]?: VariableValue | VariableDefinition;
@@ -23,8 +23,8 @@ export type AnimationDefinitions = {
23
23
  export type SelectorDefinitions = {
24
24
  [key: string]: string | string[];
25
25
  };
26
- export type MediaQueryDefinitions = {
27
- [key: string]: number | string | MediaQueryDefinitions;
26
+ export type AtDefinitions = {
27
+ [key: string]: number | string | AtDefinitions;
28
28
  };
29
29
  export type StyleDefinitions = {
30
30
  [key: string]: string | StyleDefinitions;
@@ -55,7 +55,7 @@ export type FunctionDefinitions = {
55
55
  export interface Config {
56
56
  extends?: (Config | any)[];
57
57
  styles?: StyleDefinitions;
58
- queries?: MediaQueryDefinitions;
58
+ at?: AtDefinitions;
59
59
  selectors?: SelectorDefinitions;
60
60
  utilities?: UtilityDefinitions;
61
61
  variables?: VariableDefinitions;
@@ -1,4 +1,4 @@
1
- import queries from './queries.mjs';
1
+ import at from './at.mjs';
2
2
  import selectors from './selectors.mjs';
3
3
  import utilities from './utilities.mjs';
4
4
  import animations from './animations.mjs';
@@ -8,7 +8,7 @@ import modes from './modes.mjs';
8
8
  import functions from './functions.mjs';
9
9
 
10
10
  const config = {
11
- queries,
11
+ at,
12
12
  selectors,
13
13
  utilities,
14
14
  rules,
@@ -23,4 +23,4 @@ const config = {
23
23
  important: false
24
24
  };
25
25
 
26
- export { animations, config, functions, modes, queries, rules, selectors, utilities, variables };
26
+ export { animations, at, config, functions, modes, rules, selectors, utilities, variables };
@@ -2263,6 +2263,7 @@ const rules = {
2263
2263
  layer: layer.Native
2264
2264
  },
2265
2265
  'clip-path': {
2266
+ key: 'clip',
2266
2267
  layer: layer.Native
2267
2268
  },
2268
2269
  quotes: {
@@ -2261,6 +2261,7 @@ const rules = {
2261
2261
  layer: Layer.Native
2262
2262
  },
2263
2263
  'clip-path': {
2264
+ key: 'clip',
2264
2265
  layer: Layer.Native
2265
2266
  },
2266
2267
  quotes: {
@@ -1,13 +1,25 @@
1
1
  'use strict';
2
2
 
3
3
  var colors = require('@master/colors');
4
- var screenSizes = require('../tokens/screen-sizes.cjs');
5
4
 
6
5
  const variables = {
7
6
  full: '100%',
8
7
  fit: 'fit-content',
9
8
  max: 'max-content',
10
9
  min: 'min-content',
10
+ screen: {
11
+ '4xs': 360,
12
+ '3xs': 480,
13
+ '2xs': 600,
14
+ 'xs': 768,
15
+ 'sm': 834,
16
+ 'md': 1024,
17
+ 'lg': 1280,
18
+ 'xl': 1440,
19
+ '2xl': 1600,
20
+ '3xl': 1920,
21
+ '4xl': 2560
22
+ },
11
23
  'font-family': {
12
24
  mono: [
13
25
  'ui-monospace',
@@ -44,7 +56,6 @@ const variables = {
44
56
  'serif'
45
57
  ]
46
58
  },
47
- screen: screenSizes,
48
59
  'font-weight': {
49
60
  thin: 100,
50
61
  extralight: 200,
@@ -419,11 +419,6 @@ declare const variables: {
419
419
  fit: string;
420
420
  max: string;
421
421
  min: string;
422
- 'font-family': {
423
- mono: string[];
424
- sans: string[];
425
- serif: string[];
426
- };
427
422
  screen: {
428
423
  '4xs': number;
429
424
  '3xs': number;
@@ -437,6 +432,11 @@ declare const variables: {
437
432
  '3xl': number;
438
433
  '4xl': number;
439
434
  };
435
+ 'font-family': {
436
+ mono: string[];
437
+ sans: string[];
438
+ serif: string[];
439
+ };
440
440
  'font-weight': {
441
441
  thin: number;
442
442
  extralight: number;
@@ -1,11 +1,23 @@
1
1
  import colors from '@master/colors';
2
- import screenSizes from '../tokens/screen-sizes.mjs';
3
2
 
4
3
  const variables = {
5
4
  full: '100%',
6
5
  fit: 'fit-content',
7
6
  max: 'max-content',
8
7
  min: 'min-content',
8
+ screen: {
9
+ '4xs': 360,
10
+ '3xs': 480,
11
+ '2xs': 600,
12
+ 'xs': 768,
13
+ 'sm': 834,
14
+ 'md': 1024,
15
+ 'lg': 1280,
16
+ 'xl': 1440,
17
+ '2xl': 1600,
18
+ '3xl': 1920,
19
+ '4xl': 2560
20
+ },
9
21
  'font-family': {
10
22
  mono: [
11
23
  'ui-monospace',
@@ -42,7 +54,6 @@ const variables = {
42
54
  'serif'
43
55
  ]
44
56
  },
45
- screen: screenSizes,
46
57
  'font-weight': {
47
58
  thin: 100,
48
59
  extralight: 200,
package/dist/core.cjs CHANGED
@@ -17,7 +17,7 @@ class MasterCSS {
17
17
  classesUsage;
18
18
  config;
19
19
  Rules;
20
- constructor(customConfig = index.config){
20
+ constructor(customConfig){
21
21
  this.customConfig = customConfig;
22
22
  this.rules = [];
23
23
  this.ruleBy = {};
@@ -38,7 +38,7 @@ class MasterCSS {
38
38
  this.stylesBy = {};
39
39
  this.selectors = {};
40
40
  this.variables = {};
41
- this.queries = {};
41
+ this.at = {};
42
42
  this.animations = {};
43
43
  this.Rules.length = 0;
44
44
  this.variablesNativeRules = {};
@@ -48,7 +48,7 @@ class MasterCSS {
48
48
  currentColor: undefined,
49
49
  transparent: undefined
50
50
  };
51
- const { styles, selectors, variables, utilities, queries, rules, animations } = this.config;
51
+ const { styles, selectors, variables, utilities, at, rules, animations } = this.config;
52
52
  function escapeString(str) {
53
53
  return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
54
54
  }
@@ -99,6 +99,11 @@ class MasterCSS {
99
99
  }
100
100
  colorVariableNames[flatName] = undefined;
101
101
  }
102
+ /**
103
+ * resolve `variables.screen-*` to `at.*`
104
+ */ if (variable.name.startsWith('screen-') && variable.type === 'number') {
105
+ this.at[variable.name.slice(7)] = variable.value;
106
+ }
102
107
  const currentMode = replacedMode ?? mode;
103
108
  if (currentMode !== undefined) {
104
109
  if (Object.prototype.hasOwnProperty.call(this.variables, flatName)) {
@@ -259,8 +264,8 @@ class MasterCSS {
259
264
  }
260
265
  }
261
266
  }
262
- if (queries) {
263
- this.queries = flattenObject.flattenObject(queries);
267
+ if (at) {
268
+ Object.assign(this.at, flattenObject.flattenObject(at));
264
269
  }
265
270
  if (animations) {
266
271
  for(const animationName in animations){
package/dist/core.d.ts CHANGED
@@ -26,14 +26,14 @@ export type ColorVariable = {
26
26
  export type TypeVariable = StringVariable | NumberVariable | ColorVariable;
27
27
  export type Variable = TypeVariable & VariableCommon;
28
28
  export default class MasterCSS {
29
- customConfig: Config;
29
+ customConfig?: Config | undefined;
30
30
  static config: Config;
31
31
  readonly rules: Rule[];
32
32
  readonly ruleBy: Record<string, Rule>;
33
33
  readonly classesUsage: Record<string, number>;
34
34
  readonly config: Config;
35
35
  readonly Rules: RegisteredRule[];
36
- constructor(customConfig?: Config);
36
+ constructor(customConfig?: Config | undefined);
37
37
  resolve(): void;
38
38
  /**
39
39
  * Match check if Master CSS syntax
@@ -89,7 +89,7 @@ export default interface MasterCSS {
89
89
  stylesBy: Record<string, string[]>;
90
90
  selectors: Record<string, [RegExp, string[]][]>;
91
91
  variables: Record<string, Variable>;
92
- queries: Record<string, string | number>;
92
+ at: Record<string, string | number>;
93
93
  variablesNativeRules: Record<string, NativeRule>;
94
94
  hasKeyframesRule: boolean;
95
95
  animations: Record<string, AnimationDefinitions & {
package/dist/core.mjs CHANGED
@@ -13,7 +13,7 @@ class MasterCSS {
13
13
  classesUsage;
14
14
  config;
15
15
  Rules;
16
- constructor(customConfig = config){
16
+ constructor(customConfig){
17
17
  this.customConfig = customConfig;
18
18
  this.rules = [];
19
19
  this.ruleBy = {};
@@ -34,7 +34,7 @@ class MasterCSS {
34
34
  this.stylesBy = {};
35
35
  this.selectors = {};
36
36
  this.variables = {};
37
- this.queries = {};
37
+ this.at = {};
38
38
  this.animations = {};
39
39
  this.Rules.length = 0;
40
40
  this.variablesNativeRules = {};
@@ -44,7 +44,7 @@ class MasterCSS {
44
44
  currentColor: undefined,
45
45
  transparent: undefined
46
46
  };
47
- const { styles, selectors, variables, utilities, queries, rules, animations } = this.config;
47
+ const { styles, selectors, variables, utilities, at, rules, animations } = this.config;
48
48
  function escapeString(str) {
49
49
  return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
50
50
  }
@@ -95,6 +95,11 @@ class MasterCSS {
95
95
  }
96
96
  colorVariableNames[flatName] = undefined;
97
97
  }
98
+ /**
99
+ * resolve `variables.screen-*` to `at.*`
100
+ */ if (variable.name.startsWith('screen-') && variable.type === 'number') {
101
+ this.at[variable.name.slice(7)] = variable.value;
102
+ }
98
103
  const currentMode = replacedMode ?? mode;
99
104
  if (currentMode !== undefined) {
100
105
  if (Object.prototype.hasOwnProperty.call(this.variables, flatName)) {
@@ -255,8 +260,8 @@ class MasterCSS {
255
260
  }
256
261
  }
257
262
  }
258
- if (queries) {
259
- this.queries = flattenObject(queries);
263
+ if (at) {
264
+ Object.assign(this.at, flattenObject(at));
260
265
  }
261
266
  if (animations) {
262
267
  for(const animationName in animations){
package/dist/index.cjs CHANGED
@@ -10,13 +10,13 @@ var layer = require('./layer.cjs');
10
10
  var extendConfig = require('./utils/extend-config.cjs');
11
11
  var reorderForReadableClasses = require('./utils/reorder-for-readable-classes.cjs');
12
12
  var areRuleModesEqual = require('./utils/are-rule-modes-equal.cjs');
13
- var areRuleQueriesEqual = require('./utils/are-rule-queries-equal.cjs');
13
+ var areRuleAtEqual = require('./utils/are-rule-at-equal.cjs');
14
14
  var areRuleSelectorsEqual = require('./utils/are-rule-selectors-equal.cjs');
15
15
  var areRuleStatesEqual = require('./utils/are-rule-states-equal.cjs');
16
16
  var areRulesDuplicated = require('./utils/are-rules-duplicated.cjs');
17
17
  var generateCss = require('./utils/generate-css.cjs');
18
18
  var isCoreRule = require('./utils/is-core-rule.cjs');
19
- var queries = require('./config/queries.cjs');
19
+ var at = require('./config/at.cjs');
20
20
  var selectors = require('./config/selectors.cjs');
21
21
  var utilities = require('./config/utilities.cjs');
22
22
  var functions = require('./config/functions.cjs');
@@ -57,13 +57,13 @@ exports.Layer = layer;
57
57
  exports.extendConfig = extendConfig;
58
58
  exports.reorderForReadableClasses = reorderForReadableClasses;
59
59
  exports.areRuleModesEqual = areRuleModesEqual;
60
- exports.areRuleQueriesEqual = areRuleQueriesEqual;
60
+ exports.areRuleAtEqual = areRuleAtEqual;
61
61
  exports.areRuleSelectorsEqual = areRuleSelectorsEqual;
62
62
  exports.areRuleStatesEqual = areRuleStatesEqual;
63
63
  exports.areRulesDuplicated = areRulesDuplicated;
64
64
  exports.generateCSS = generateCss;
65
65
  exports.isCoreRule = isCoreRule;
66
- exports.queries = queries;
66
+ exports.at = at;
67
67
  exports.selectors = selectors;
68
68
  exports.utilities = utilities;
69
69
  exports.functions = functions;
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export { default as MasterCSS, default } from './core';
8
8
  export { default as extendConfig } from './utils/extend-config';
9
9
  export { default as reorderForReadableClasses } from './utils/reorder-for-readable-classes';
10
10
  export { default as areRuleModesEqual } from './utils/are-rule-modes-equal';
11
- export { default as areRuleQueriesEqual } from './utils/are-rule-queries-equal';
11
+ export { default as areRuleAtEqual } from './utils/are-rule-at-equal';
12
12
  export { default as areRuleSelectorsEqual } from './utils/are-rule-selectors-equal';
13
13
  export { default as areRuleStatesEqual } from './utils/are-rule-states-equal';
14
14
  export { default as areRulesDuplicated } from './utils/are-rules-duplicated';
package/dist/index.mjs CHANGED
@@ -6,13 +6,13 @@ export { default as Layer } from './layer.mjs';
6
6
  export { default as extendConfig } from './utils/extend-config.mjs';
7
7
  export { default as reorderForReadableClasses } from './utils/reorder-for-readable-classes.mjs';
8
8
  export { default as areRuleModesEqual } from './utils/are-rule-modes-equal.mjs';
9
- export { default as areRuleQueriesEqual } from './utils/are-rule-queries-equal.mjs';
9
+ export { default as areRuleAtEqual } from './utils/are-rule-at-equal.mjs';
10
10
  export { default as areRuleSelectorsEqual } from './utils/are-rule-selectors-equal.mjs';
11
11
  export { default as areRuleStatesEqual } from './utils/are-rule-states-equal.mjs';
12
12
  export { default as areRulesDuplicated } from './utils/are-rules-duplicated.mjs';
13
13
  export { default as generateCSS } from './utils/generate-css.mjs';
14
14
  export { default as isCoreRule } from './utils/is-core-rule.mjs';
15
- export { default as queries } from './config/queries.mjs';
15
+ export { default as at } from './config/at.mjs';
16
16
  export { default as selectors } from './config/selectors.mjs';
17
17
  export { default as utilities } from './config/utilities.mjs';
18
18
  export { default as functions } from './config/functions.mjs';
package/dist/rule.cjs CHANGED
@@ -267,7 +267,7 @@ class Rule {
267
267
  ','
268
268
  ];
269
269
  const { scope, important, modes } = css.config;
270
- const { selectors, queries, stylesBy, animations } = css;
270
+ const { selectors, at, stylesBy, animations } = css;
271
271
  const classNames = stylesBy[className];
272
272
  if (create) create.call(this, className);
273
273
  // 1. value / selectorToken
@@ -480,14 +480,14 @@ class Rule {
480
480
  value: 'and'
481
481
  });
482
482
  } else if (atComponentToken.startsWith('')) {
483
- const targetQuery = queries[atComponentToken];
484
- if (targetQuery && typeof targetQuery === 'string') {
485
- const match = targetQuery.match(queryTypeRegExp);
483
+ const targetAt = at[atComponentToken];
484
+ if (targetAt && typeof targetAt === 'string') {
485
+ const match = targetAt.match(queryTypeRegExp);
486
486
  queryType = match ? match[1] : '';
487
- if (!queryType) throw new Error(`Invalid query '${atComponentToken}': '${targetQuery}'`);
487
+ if (!queryType) throw new Error(`Invalid query '${atComponentToken}': '${targetAt}'`);
488
488
  atComponents.push({
489
489
  type: 'arbitrary',
490
- value: targetQuery.slice(match ? match[1].length + 1 : 0)
490
+ value: targetAt.slice(match ? match[1].length + 1 : 0)
491
491
  });
492
492
  } else {
493
493
  // todo: container queries
@@ -506,12 +506,12 @@ class Rule {
506
506
  extremumOperator = '<';
507
507
  featureName = 'max-width';
508
508
  correction = -.02;
509
- } else if (atComponentToken.startsWith('>=') || targetQuery) {
509
+ } else if (atComponentToken.startsWith('>=') || targetAt) {
510
510
  extremumOperator = '>=';
511
511
  featureName = 'min-width';
512
512
  }
513
513
  const token = extremumOperator ? atComponentToken.replace(extremumOperator, '') : atComponentToken;
514
- const viewport = queries[token];
514
+ const viewport = at[token];
515
515
  switch(featureName){
516
516
  case 'max-width':
517
517
  case 'min-width':
package/dist/rule.mjs CHANGED
@@ -265,7 +265,7 @@ class Rule {
265
265
  ','
266
266
  ];
267
267
  const { scope, important, modes } = css.config;
268
- const { selectors, queries, stylesBy, animations } = css;
268
+ const { selectors, at, stylesBy, animations } = css;
269
269
  const classNames = stylesBy[className];
270
270
  if (create) create.call(this, className);
271
271
  // 1. value / selectorToken
@@ -478,14 +478,14 @@ class Rule {
478
478
  value: 'and'
479
479
  });
480
480
  } else if (atComponentToken.startsWith('')) {
481
- const targetQuery = queries[atComponentToken];
482
- if (targetQuery && typeof targetQuery === 'string') {
483
- const match = targetQuery.match(queryTypeRegExp);
481
+ const targetAt = at[atComponentToken];
482
+ if (targetAt && typeof targetAt === 'string') {
483
+ const match = targetAt.match(queryTypeRegExp);
484
484
  queryType = match ? match[1] : '';
485
- if (!queryType) throw new Error(`Invalid query '${atComponentToken}': '${targetQuery}'`);
485
+ if (!queryType) throw new Error(`Invalid query '${atComponentToken}': '${targetAt}'`);
486
486
  atComponents.push({
487
487
  type: 'arbitrary',
488
- value: targetQuery.slice(match ? match[1].length + 1 : 0)
488
+ value: targetAt.slice(match ? match[1].length + 1 : 0)
489
489
  });
490
490
  } else {
491
491
  // todo: container queries
@@ -504,12 +504,12 @@ class Rule {
504
504
  extremumOperator = '<';
505
505
  featureName = 'max-width';
506
506
  correction = -.02;
507
- } else if (atComponentToken.startsWith('>=') || targetQuery) {
507
+ } else if (atComponentToken.startsWith('>=') || targetAt) {
508
508
  extremumOperator = '>=';
509
509
  featureName = 'min-width';
510
510
  }
511
511
  const token = extremumOperator ? atComponentToken.replace(extremumOperator, '') : atComponentToken;
512
- const viewport = queries[token];
512
+ const viewport = at[token];
513
513
  switch(featureName){
514
514
  case 'max-width':
515
515
  case 'min-width':
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- function areRuleQueriesEqual(aRule, bRule) {
3
+ function areRuleAtEqual(aRule, bRule) {
4
4
  const aQueryTypes = Object.keys(aRule.at);
5
5
  const bQueryTypes = Object.keys(bRule.at);
6
6
  if (aQueryTypes.length !== bQueryTypes.length) {
@@ -19,4 +19,4 @@ function areRuleQueriesEqual(aRule, bRule) {
19
19
  return true;
20
20
  }
21
21
 
22
- module.exports = areRuleQueriesEqual;
22
+ module.exports = areRuleAtEqual;
@@ -0,0 +1,2 @@
1
+ import type { Rule } from '../rule';
2
+ export default function areRuleAtEqual(aRule: Rule, bRule: Rule): boolean;
@@ -1,4 +1,4 @@
1
- function areRuleQueriesEqual(aRule, bRule) {
1
+ function areRuleAtEqual(aRule, bRule) {
2
2
  const aQueryTypes = Object.keys(aRule.at);
3
3
  const bQueryTypes = Object.keys(bRule.at);
4
4
  if (aQueryTypes.length !== bQueryTypes.length) {
@@ -17,4 +17,4 @@ function areRuleQueriesEqual(aRule, bRule) {
17
17
  return true;
18
18
  }
19
19
 
20
- export { areRuleQueriesEqual as default };
20
+ export { areRuleAtEqual as default };
@@ -2,10 +2,10 @@
2
2
 
3
3
  var areRuleSelectorsEqual = require('./are-rule-selectors-equal.cjs');
4
4
  var areRuleModesEqual = require('./are-rule-modes-equal.cjs');
5
- var areRuleQueriesEqual = require('./are-rule-queries-equal.cjs');
5
+ var areRuleAtEqual = require('./are-rule-at-equal.cjs');
6
6
 
7
7
  function areRuleStatesEqual(aRule, bRule) {
8
- return areRuleSelectorsEqual(aRule, bRule) && areRuleModesEqual(aRule, bRule) && areRuleQueriesEqual(aRule, bRule);
8
+ return areRuleSelectorsEqual(aRule, bRule) && areRuleModesEqual(aRule, bRule) && areRuleAtEqual(aRule, bRule);
9
9
  }
10
10
 
11
11
  module.exports = areRuleStatesEqual;
@@ -1,9 +1,9 @@
1
1
  import areRuleSelectorsEqual from './are-rule-selectors-equal.mjs';
2
2
  import areRuleModesEqual from './are-rule-modes-equal.mjs';
3
- import areRuleQueriesEqual from './are-rule-queries-equal.mjs';
3
+ import areRuleAtEqual from './are-rule-at-equal.mjs';
4
4
 
5
5
  function areRuleStatesEqual(aRule, bRule) {
6
- return areRuleSelectorsEqual(aRule, bRule) && areRuleModesEqual(aRule, bRule) && areRuleQueriesEqual(aRule, bRule);
6
+ return areRuleSelectorsEqual(aRule, bRule) && areRuleModesEqual(aRule, bRule) && areRuleAtEqual(aRule, bRule);
7
7
  }
8
8
 
9
9
  export { areRuleStatesEqual as default };
@@ -20,8 +20,8 @@ function extendConfig(...configs) {
20
20
  if (clonedConfig.styles) {
21
21
  formatDeeply(clonedConfig.styles);
22
22
  }
23
- if (clonedConfig.queries) {
24
- formatDeeply(clonedConfig.queries);
23
+ if (clonedConfig.at) {
24
+ formatDeeply(clonedConfig.at);
25
25
  }
26
26
  if (clonedConfig.variables) {
27
27
  formatDeeply(clonedConfig.variables);
@@ -30,6 +30,7 @@ function extendConfig(...configs) {
30
30
  };
31
31
  const formattedConfigs = [];
32
32
  for (const eachConfig of configs){
33
+ if (!eachConfig) continue;
33
34
  (function getConfigsDeeply(config) {
34
35
  if (config.extends?.length) {
35
36
  for (const eachExtend of config.extends){
@@ -42,7 +43,7 @@ function extendConfig(...configs) {
42
43
  let extendedConfig = {
43
44
  animations: {},
44
45
  styles: {},
45
- queries: {},
46
+ at: {},
46
47
  variables: {}
47
48
  };
48
49
  for(let i = 0; i < formattedConfigs.length; i++){
@@ -1,2 +1,2 @@
1
1
  import type { Config } from '../config';
2
- export default function extendConfig(...configs: Config[]): Config;
2
+ export default function extendConfig(...configs: (Config | undefined)[]): Config;
@@ -18,8 +18,8 @@ function extendConfig(...configs) {
18
18
  if (clonedConfig.styles) {
19
19
  formatDeeply(clonedConfig.styles);
20
20
  }
21
- if (clonedConfig.queries) {
22
- formatDeeply(clonedConfig.queries);
21
+ if (clonedConfig.at) {
22
+ formatDeeply(clonedConfig.at);
23
23
  }
24
24
  if (clonedConfig.variables) {
25
25
  formatDeeply(clonedConfig.variables);
@@ -28,6 +28,7 @@ function extendConfig(...configs) {
28
28
  };
29
29
  const formattedConfigs = [];
30
30
  for (const eachConfig of configs){
31
+ if (!eachConfig) continue;
31
32
  (function getConfigsDeeply(config) {
32
33
  if (config.extends?.length) {
33
34
  for (const eachExtend of config.extends){
@@ -40,7 +41,7 @@ function extendConfig(...configs) {
40
41
  let extendedConfig = {
41
42
  animations: {},
42
43
  styles: {},
43
- queries: {},
44
+ at: {},
44
45
  variables: {}
45
46
  };
46
47
  for(let i = 0; i < formattedConfigs.length; i++){
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/core"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.0.0","@master/normal.css":"^3.0.0","@techor/extend":"^3.0.22","csstype":"^3.1.3"},"devDependencies":{"@master/css-shared":"^2.0.0-rc.39"},"version":"2.0.0-rc.39"}
1
+ {"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/core"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.0.0","@master/normal.css":"^3.0.0","@techor/extend":"^3.0.22","csstype":"^3.1.3"},"devDependencies":{"@master/css-shared":"^2.0.0-rc.40"},"version":"2.0.0-rc.40"}
@@ -1,22 +0,0 @@
1
- declare const queries: {
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
- all: string;
14
- print: string;
15
- screen: string;
16
- speech: string;
17
- landscape: string;
18
- portrait: string;
19
- motion: string;
20
- 'reduced-motion': string;
21
- };
22
- export default queries;
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- var screenSizes = {
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 = screenSizes;
@@ -1,14 +0,0 @@
1
- declare const _default: {
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 _default;
@@ -1,15 +0,0 @@
1
- var screenSizes = {
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 { screenSizes as default };
@@ -1,2 +0,0 @@
1
- import type { Rule } from '../rule';
2
- export default function areRuleQueriesEqual(aRule: Rule, bRule: Rule): boolean;