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

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.
package/dist/core.cjs CHANGED
@@ -679,33 +679,22 @@ class MasterCSS {
679
679
  const range = maxWidthFeature.value - minWidthFeature.value;
680
680
  let i = matchEndIndex;
681
681
  const endI = matchStartIndex;
682
- matchStartIndex = undefined;
682
+ matchStartIndex = matchEndIndex + 1;
683
683
  for(; i >= endI; i--){
684
684
  const eachRule = this.rules[i];
685
685
  const eachMaxWidthFeature = eachRule.at.media?.find(({ name })=>name === 'max-width');
686
686
  const eachMinWidthFeature = eachRule.at.media?.find(({ name })=>name === 'min-width');
687
- const eachRange = eachMaxWidthFeature.value - eachMinWidthFeature.value;
688
- if (eachRange < range) {
689
- matchEndIndex = i - 1;
690
- } else if (eachRange === range) {
691
- matchStartIndex = i;
692
- } else {
693
- break;
694
- }
695
- }
696
- }
697
- if (matchStartIndex !== -1 && matchStartIndex !== undefined) {
698
- const range = maxWidthFeature.value - minWidthFeature.value;
699
- for(let i = matchEndIndex; i >= matchStartIndex; i--){
700
- const eachRule = this.rules[i];
701
- const eachMaxWidthFeature = eachRule.at.media?.find(({ name })=>name === 'max-width');
702
- const eachMinWidthFeature = eachRule.at.media?.find(({ name })=>name === 'min-width');
703
- const eachRange = eachMaxWidthFeature.value - eachMinWidthFeature.value;
704
- if (eachRange < range) {
705
- matchEndIndex = i - 1;
706
- } else if (eachRange > range) {
707
- matchStartIndex = i + 1;
687
+ if (!eachMaxWidthFeature || !eachMinWidthFeature) {
708
688
  break;
689
+ } else {
690
+ const eachRange = eachMaxWidthFeature.value - eachMinWidthFeature.value;
691
+ if (eachRange < range) {
692
+ matchEndIndex = i - 1;
693
+ } else if (eachRange === range) {
694
+ matchStartIndex = i;
695
+ } else {
696
+ break;
697
+ }
709
698
  }
710
699
  }
711
700
  }
package/dist/core.mjs CHANGED
@@ -675,33 +675,22 @@ class MasterCSS {
675
675
  const range = maxWidthFeature.value - minWidthFeature.value;
676
676
  let i = matchEndIndex;
677
677
  const endI = matchStartIndex;
678
- matchStartIndex = undefined;
678
+ matchStartIndex = matchEndIndex + 1;
679
679
  for(; i >= endI; i--){
680
680
  const eachRule = this.rules[i];
681
681
  const eachMaxWidthFeature = eachRule.at.media?.find(({ name })=>name === 'max-width');
682
682
  const eachMinWidthFeature = eachRule.at.media?.find(({ name })=>name === 'min-width');
683
- const eachRange = eachMaxWidthFeature.value - eachMinWidthFeature.value;
684
- if (eachRange < range) {
685
- matchEndIndex = i - 1;
686
- } else if (eachRange === range) {
687
- matchStartIndex = i;
688
- } else {
689
- break;
690
- }
691
- }
692
- }
693
- if (matchStartIndex !== -1 && matchStartIndex !== undefined) {
694
- const range = maxWidthFeature.value - minWidthFeature.value;
695
- for(let i = matchEndIndex; i >= matchStartIndex; i--){
696
- const eachRule = this.rules[i];
697
- const eachMaxWidthFeature = eachRule.at.media?.find(({ name })=>name === 'max-width');
698
- const eachMinWidthFeature = eachRule.at.media?.find(({ name })=>name === 'min-width');
699
- const eachRange = eachMaxWidthFeature.value - eachMinWidthFeature.value;
700
- if (eachRange < range) {
701
- matchEndIndex = i - 1;
702
- } else if (eachRange > range) {
703
- matchStartIndex = i + 1;
683
+ if (!eachMaxWidthFeature || !eachMinWidthFeature) {
704
684
  break;
685
+ } else {
686
+ const eachRange = eachMaxWidthFeature.value - eachMinWidthFeature.value;
687
+ if (eachRange < range) {
688
+ matchEndIndex = i - 1;
689
+ } else if (eachRange === range) {
690
+ matchStartIndex = i;
691
+ } else {
692
+ break;
693
+ }
705
694
  }
706
695
  }
707
696
  }
package/dist/rule.cjs CHANGED
@@ -498,10 +498,7 @@ class Rule {
498
498
  if (atComponentToken.startsWith('<=')) {
499
499
  extremumOperator = '<=';
500
500
  featureName = 'max-width';
501
- } else if (atComponentToken.startsWith('>=') || targetQuery) {
502
- extremumOperator = '>=';
503
- featureName = 'min-width';
504
- } else if (atComponentToken.startsWith('>')) {
501
+ } else if (atComponentToken.startsWith('>') && !atComponentToken.startsWith('>=')) {
505
502
  extremumOperator = '>';
506
503
  featureName = 'min-width';
507
504
  correction = .02;
@@ -509,6 +506,9 @@ class Rule {
509
506
  extremumOperator = '<';
510
507
  featureName = 'max-width';
511
508
  correction = -.02;
509
+ } else if (atComponentToken.startsWith('>=') || targetQuery) {
510
+ extremumOperator = '>=';
511
+ featureName = 'min-width';
512
512
  }
513
513
  const token = extremumOperator ? atComponentToken.replace(extremumOperator, '') : atComponentToken;
514
514
  const viewport = queries[token];
package/dist/rule.mjs CHANGED
@@ -496,10 +496,7 @@ class Rule {
496
496
  if (atComponentToken.startsWith('<=')) {
497
497
  extremumOperator = '<=';
498
498
  featureName = 'max-width';
499
- } else if (atComponentToken.startsWith('>=') || targetQuery) {
500
- extremumOperator = '>=';
501
- featureName = 'min-width';
502
- } else if (atComponentToken.startsWith('>')) {
499
+ } else if (atComponentToken.startsWith('>') && !atComponentToken.startsWith('>=')) {
503
500
  extremumOperator = '>';
504
501
  featureName = 'min-width';
505
502
  correction = .02;
@@ -507,6 +504,9 @@ class Rule {
507
504
  extremumOperator = '<';
508
505
  featureName = 'max-width';
509
506
  correction = -.02;
507
+ } else if (atComponentToken.startsWith('>=') || targetQuery) {
508
+ extremumOperator = '>=';
509
+ featureName = 'min-width';
510
510
  }
511
511
  const token = extremumOperator ? atComponentToken.replace(extremumOperator, '') : atComponentToken;
512
512
  const viewport = queries[token];
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"jest","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.38"},"version":"2.0.0-rc.38"}
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"}