@master/css 2.0.0-rc.32 → 2.0.0-rc.34
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/common.cjs
CHANGED
|
@@ -101,7 +101,7 @@ const VALUE_UNITS = [
|
|
|
101
101
|
];
|
|
102
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)?$/;
|
|
103
103
|
const IMAGE_VALUE_REGEX = /(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\(.*\)/;
|
|
104
|
-
const COLOR_VALUE_REGEX = /(?:#|(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla)
|
|
104
|
+
const COLOR_VALUE_REGEX = /(?:#|(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla)\(.*\)|(?:\$colors)(?![a-zA-Z0-9-]))/;
|
|
105
105
|
const NUMBER_VALUE_REGEX = /(?:[\d.]|(?:max|min|calc|clamp)\(.*\))/;
|
|
106
106
|
const OFFICIAL_URL = new URL('https://rc.css.master.co');
|
|
107
107
|
const CLASS_ATTRIBUTES = [
|
package/dist/common.mjs
CHANGED
|
@@ -99,7 +99,7 @@ const VALUE_UNITS = [
|
|
|
99
99
|
];
|
|
100
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)?$/;
|
|
101
101
|
const IMAGE_VALUE_REGEX = /(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\(.*\)/;
|
|
102
|
-
const COLOR_VALUE_REGEX = /(?:#|(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla)
|
|
102
|
+
const COLOR_VALUE_REGEX = /(?:#|(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla)\(.*\)|(?:\$colors)(?![a-zA-Z0-9-]))/;
|
|
103
103
|
const NUMBER_VALUE_REGEX = /(?:[\d.]|(?:max|min|calc|clamp)\(.*\))/;
|
|
104
104
|
const OFFICIAL_URL = new URL('https://rc.css.master.co');
|
|
105
105
|
const CLASS_ATTRIBUTES = [
|
|
@@ -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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
11
|
-
|
|
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.
|
|
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.34","csstype":"^3.1.3"},"version":"2.0.0-rc.34"}
|