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

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.
@@ -9,10 +9,8 @@ var core = require('../core.cjs');
9
9
  * @param options
10
10
  * @returns consistent classes
11
11
  */ function reorderForReadableClasses(classes, css = new core.default()) {
12
- for (const eachClass of classes){
13
- css.add(eachClass);
14
- }
15
- return css.rules// 只保留樣式語法相關的 rules, 排除 keyframes 與 variables 在外
12
+ css.add(...classes);
13
+ const orderedClasses = css.rules// 只保留樣式語法相關的 rules, 排除 keyframes 與 variables 在外
16
14
  .filter((eachRule)=>eachRule.layer).sort((a, b)=>{
17
15
  if (a.layer === layer.Utility && b.layer !== layer.Utility) {
18
16
  // 如果 a 是 Layer.Utility 而 b 不是,则 a 应该排在 b 前面
@@ -57,6 +55,8 @@ var core = require('../core.cjs');
57
55
  return a.order - b.order;
58
56
  }
59
57
  }).map((eachRule)=>eachRule.className);
58
+ css.delete(...classes);
59
+ return orderedClasses;
60
60
  }
61
61
 
62
62
  module.exports = reorderForReadableClasses;
@@ -7,10 +7,8 @@ import MasterCSS from '../core.mjs';
7
7
  * @param options
8
8
  * @returns consistent classes
9
9
  */ function reorderForReadableClasses(classes, css = new MasterCSS()) {
10
- for (const eachClass of classes){
11
- css.add(eachClass);
12
- }
13
- return css.rules// 只保留樣式語法相關的 rules, 排除 keyframes 與 variables 在外
10
+ css.add(...classes);
11
+ const orderedClasses = css.rules// 只保留樣式語法相關的 rules, 排除 keyframes 與 variables 在外
14
12
  .filter((eachRule)=>eachRule.layer).sort((a, b)=>{
15
13
  if (a.layer === Layer.Utility && b.layer !== Layer.Utility) {
16
14
  // 如果 a 是 Layer.Utility 而 b 不是,则 a 应该排在 b 前面
@@ -55,6 +53,8 @@ import MasterCSS from '../core.mjs';
55
53
  return a.order - b.order;
56
54
  }
57
55
  }).map((eachRule)=>eachRule.className);
56
+ css.delete(...classes);
57
+ return orderedClasses;
58
58
  }
59
59
 
60
60
  export { reorderForReadableClasses as default };
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":"^2.1.0","@techor/extend":"^3.0.20"},"devDependencies":{"@master/css-shared":"^2.0.0-rc.31","csstype":"^3.1.3"},"version":"2.0.0-rc.31"}
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":"^2.1.0","@techor/extend":"^3.0.20"},"devDependencies":{"@master/css-shared":"^2.0.0-rc.33","csstype":"^3.1.3"},"version":"2.0.0-rc.33"}