@master/css 2.0.0-rc.56 → 2.0.0-rc.58

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.
@@ -8,7 +8,9 @@ const at = {
8
8
  landscape: 'media (orientation:landscape)',
9
9
  portrait: 'media (orientation:portrait)',
10
10
  motion: 'media (prefers-reduced-motion:no-preference)',
11
- 'reduced-motion': 'media (prefers-reduced-motion:reduce)'
11
+ 'reduced-motion': 'media (prefers-reduced-motion:reduce)',
12
+ base: 'layer base',
13
+ preset: 'layer preset'
12
14
  };
13
15
 
14
16
  module.exports = at;
@@ -7,5 +7,7 @@ declare const at: {
7
7
  portrait: string;
8
8
  motion: string;
9
9
  'reduced-motion': string;
10
+ base: string;
11
+ preset: string;
10
12
  };
11
13
  export default at;
@@ -6,7 +6,9 @@ const at = {
6
6
  landscape: 'media (orientation:landscape)',
7
7
  portrait: 'media (orientation:portrait)',
8
8
  motion: 'media (prefers-reduced-motion:no-preference)',
9
- 'reduced-motion': 'media (prefers-reduced-motion:reduce)'
9
+ 'reduced-motion': 'media (prefers-reduced-motion:reduce)',
10
+ base: 'layer base',
11
+ preset: 'layer preset'
10
12
  };
11
13
 
12
14
  export { at as default };
@@ -94,10 +94,11 @@ class SyntaxLayer extends layer {
94
94
  }
95
95
  if (matchStartIndex !== -1) {
96
96
  for(let i = matchEndIndex; i >= matchStartIndex; i--){
97
- const value = (this.rules[i].at.media?.find(({ name })=>name === 'min-width')).value;
98
- if (value > minWidthFeature.value) {
97
+ const feature = this.rules[i].at.media?.find(({ name })=>name === 'min-width');
98
+ if (!feature) continue;
99
+ if (feature.value > minWidthFeature.value) {
99
100
  matchEndIndex = i - 1;
100
- } else if (value < minWidthFeature.value) {
101
+ } else if (feature.value < minWidthFeature.value) {
101
102
  matchStartIndex = i + 1;
102
103
  break;
103
104
  }
@@ -116,10 +117,11 @@ class SyntaxLayer extends layer {
116
117
  }
117
118
  if (matchStartIndex !== -1) {
118
119
  for(let i = matchEndIndex; i >= matchStartIndex; i--){
119
- const value = (this.rules[i].at.media?.find(({ name })=>name === 'max-width')).value;
120
- if (value < maxWidthFeature.value) {
120
+ const feature = this.rules[i].at.media?.find(({ name })=>name === 'max-width');
121
+ if (!feature) continue;
122
+ if (feature.value < maxWidthFeature.value) {
121
123
  matchEndIndex = i - 1;
122
- } else if (value > maxWidthFeature.value) {
124
+ } else if (feature.value > maxWidthFeature.value) {
123
125
  matchStartIndex = i + 1;
124
126
  break;
125
127
  }
@@ -92,10 +92,11 @@ class SyntaxLayer extends Layer {
92
92
  }
93
93
  if (matchStartIndex !== -1) {
94
94
  for(let i = matchEndIndex; i >= matchStartIndex; i--){
95
- const value = (this.rules[i].at.media?.find(({ name })=>name === 'min-width')).value;
96
- if (value > minWidthFeature.value) {
95
+ const feature = this.rules[i].at.media?.find(({ name })=>name === 'min-width');
96
+ if (!feature) continue;
97
+ if (feature.value > minWidthFeature.value) {
97
98
  matchEndIndex = i - 1;
98
- } else if (value < minWidthFeature.value) {
99
+ } else if (feature.value < minWidthFeature.value) {
99
100
  matchStartIndex = i + 1;
100
101
  break;
101
102
  }
@@ -114,10 +115,11 @@ class SyntaxLayer extends Layer {
114
115
  }
115
116
  if (matchStartIndex !== -1) {
116
117
  for(let i = matchEndIndex; i >= matchStartIndex; i--){
117
- const value = (this.rules[i].at.media?.find(({ name })=>name === 'max-width')).value;
118
- if (value < maxWidthFeature.value) {
118
+ const feature = this.rules[i].at.media?.find(({ name })=>name === 'max-width');
119
+ if (!feature) continue;
120
+ if (feature.value < maxWidthFeature.value) {
119
121
  matchEndIndex = i - 1;
120
- } else if (value > maxWidthFeature.value) {
122
+ } else if (feature.value > maxWidthFeature.value) {
121
123
  matchStartIndex = i + 1;
122
124
  break;
123
125
  }
@@ -343,10 +343,10 @@ class SyntaxRule extends rule.Rule {
343
343
  const atToken = stateTokens[i];
344
344
  this.atToken = (this.atToken || '') + '@' + atToken;
345
345
  if (atToken) {
346
- if (atToken === 'base') {
346
+ if (atToken === 'base' && !this.fixedClass) {
347
347
  this.layer = css.baseLayer;
348
348
  continue;
349
- } else if (atToken === 'preset') {
349
+ } else if (atToken === 'preset' && !this.fixedClass) {
350
350
  this.layer = css.presetLayer;
351
351
  continue;
352
352
  } else if (atToken === 'rtl' || atToken === 'ltr') {
@@ -341,10 +341,10 @@ class SyntaxRule extends Rule {
341
341
  const atToken = stateTokens[i];
342
342
  this.atToken = (this.atToken || '') + '@' + atToken;
343
343
  if (atToken) {
344
- if (atToken === 'base') {
344
+ if (atToken === 'base' && !this.fixedClass) {
345
345
  this.layer = css.baseLayer;
346
346
  continue;
347
- } else if (atToken === 'preset') {
347
+ } else if (atToken === 'preset' && !this.fixedClass) {
348
348
  this.layer = css.presetLayer;
349
349
  continue;
350
350
  } else if (atToken === 'rtl' || atToken === 'ltr') {
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"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","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":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.mjs"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.1.0","@master/normal.css":"^3.1.0","@techor/extend":"^3.2.0","csstype":"^3.1.3"},"devDependencies":{"shared":"^2.0.0-rc.56"},"version":"2.0.0-rc.56"}
1
+ {"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","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":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.mjs"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.1.0","@master/normal.css":"^3.1.0","@techor/extend":"^3.2.0","csstype":"^3.1.3"},"devDependencies":{"shared":"^2.0.0-rc.58"},"version":"2.0.0-rc.58"}