aliascss 1.3.3 → 1.3.5
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/aliascss.js +1 -1
- package/lib/build/index.js +29 -4
- package/lib/css-properties-all.js +2 -2
- package/lib/custom-css-compilers.js +45 -14
- package/lib/prebuild.d.ts +8 -112
- package/lib/prebuild.js +218 -190
- package/lib/static/customStaticClassNames.js +1 -1
- package/lib/static-animation.d.ts +90 -0
- package/lib/static-animation.js +442 -0
- package/package.json +1 -1
package/lib/build/index.js
CHANGED
|
@@ -40,7 +40,32 @@ if (!window.AliasCSS) {
|
|
|
40
40
|
// @ts-ignore
|
|
41
41
|
window.AliasCSS = AliasCSS;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
43
|
+
(() => {
|
|
44
|
+
const runScript = () => {
|
|
45
|
+
AliasCSS.classPrinter.run();
|
|
46
|
+
};
|
|
47
|
+
// 1. Run after initial DOM is ready
|
|
48
|
+
if (document.readyState === 'loading') {
|
|
49
|
+
document.addEventListener('DOMContentLoaded', runScript);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
runScript(); // DOM already parsed, run immediately
|
|
53
|
+
}
|
|
54
|
+
// 2. Re-run on every DOM change and attribute change
|
|
55
|
+
const observer = new MutationObserver(() => {
|
|
56
|
+
observer.disconnect(); // pause to avoid infinite loop
|
|
57
|
+
runScript();
|
|
58
|
+
observer.observe(document.body, {
|
|
59
|
+
childList: true,
|
|
60
|
+
subtree: true,
|
|
61
|
+
attributes: true,
|
|
62
|
+
attributeOldValue: true,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
observer.observe(document.body, {
|
|
66
|
+
childList: true,
|
|
67
|
+
subtree: true,
|
|
68
|
+
attributes: true,
|
|
69
|
+
attributeOldValue: true,
|
|
70
|
+
});
|
|
71
|
+
})();
|
|
@@ -798,7 +798,7 @@ const cssProps = {
|
|
|
798
798
|
alias: '',
|
|
799
799
|
type: 's',
|
|
800
800
|
// compiler:'',
|
|
801
|
-
values: ['normal:n', 'dark:d', 'light dark:light-dark:ld', 'only light:only-light:ol']
|
|
801
|
+
values: ['normal:n', 'dark:d', 'only dark:only-dark:od:o-d', 'light dark:light-dark:l-d:ld', 'only light:only-light:o-l:ol', 'light:l']
|
|
802
802
|
},
|
|
803
803
|
'column-count': {
|
|
804
804
|
alias: 'cc',
|
|
@@ -2498,7 +2498,7 @@ const cssProps = {
|
|
|
2498
2498
|
alias: 'tfo',
|
|
2499
2499
|
type: 'd',
|
|
2500
2500
|
compiler: length,
|
|
2501
|
-
values: [''],
|
|
2501
|
+
values: ['left:l', 'right:r', 'top:t', 'bottom:b', 'center:c'],
|
|
2502
2502
|
},
|
|
2503
2503
|
'transform-style': {
|
|
2504
2504
|
alias: 'tfs',
|
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
import prebuild from "./prebuild.js";
|
|
2
2
|
import { cssVarWithDefault } from "./utils/helper.js";
|
|
3
3
|
import color from './compilers/color.js';
|
|
4
|
-
const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
4
|
+
const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
5
|
+
// 'Button':{
|
|
6
|
+
// type:'group',
|
|
7
|
+
// compiler:(value,custom)=>{
|
|
8
|
+
// let stm='';
|
|
9
|
+
// const order=['color','background-color','border-color'];
|
|
10
|
+
// const values=value.replace(/^\(|\)$/g,'').split(',');
|
|
11
|
+
// values.forEach((e,i)=>{
|
|
12
|
+
// if(i<order.length){
|
|
13
|
+
// stm+=`${order[i]}:${color(e,custom)};`
|
|
14
|
+
// }
|
|
15
|
+
// });
|
|
16
|
+
// return stm;
|
|
17
|
+
// }
|
|
18
|
+
// options:{
|
|
19
|
+
// 'solid':'background-color:var(--main-color),color:var(--main-text-color,#fff)',
|
|
20
|
+
// 'outline':'--background-color:var(--outline-bg-color,transparent),--button-color:var(--main-color)',
|
|
21
|
+
// 'link':'background-color:var(--outline-bg-color,transparent),color:var(--main-color),border:none',
|
|
22
|
+
// 'ghost':'background:transparent',
|
|
23
|
+
// 'primary':'--button-main-color:var(--primary-color,),',
|
|
24
|
+
// 'success':'',
|
|
25
|
+
// 'error':'',
|
|
26
|
+
// 'warning':'',
|
|
27
|
+
// 'info':'',
|
|
28
|
+
// 'xs':'border-radius: 4px;padding: 0px 8px;font-size: 12px;height: 24px;line-height: 16px;gap: 4px;',
|
|
29
|
+
// 'sm':'border-radius: 4px;padding: 0px 12px;font-size: 14px;height: 32px;line-height: 20px;gap: 8px;',
|
|
30
|
+
// 'md':'border-radius: 4px;padding: 0px 15px;font-size: 15px;font-weight: 500;height: 35px;line-height: 1;',
|
|
31
|
+
// 'lg':'border-radius: 6px;padding: 0px 16px;font-size: 16px;height: 40px;line-height: 24px;gap: 12px;',
|
|
32
|
+
// 'lg':'border-radius: 6px; padding: 0px 24px;font-size: 18px;height: 48px;line-height: 26px;gap: 14px;',
|
|
33
|
+
// },
|
|
34
|
+
// },
|
|
35
|
+
'Color': {
|
|
5
36
|
type: 'group',
|
|
6
37
|
compiler: (value, custom) => {
|
|
7
38
|
let stm = '';
|
|
@@ -322,7 +353,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), { 'Color':
|
|
|
322
353
|
'x-row': {
|
|
323
354
|
type: 'group',
|
|
324
355
|
compiler: (value) => {
|
|
325
|
-
return `--x-row-gap:${value.replace(/^-(\d)/, '$1')};display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,${value.replace(/^-(\d)/, '$1')}) * -0.5);margin-right:calc(var(--x-row-gap,${value.replace(/^-(\d)/, '$1')}) * 0.5);`;
|
|
356
|
+
return `--x-row-gap:${value.trim() ? value.replace(/^-(\d)/, '$1') : '16px'};display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,${value.replace(/^-(\d)/, '$1')}) * -0.5);margin-right:calc(var(--x-row-gap,${value.replace(/^-(\d)/, '$1')}) * 0.5);`;
|
|
326
357
|
},
|
|
327
358
|
groups: {
|
|
328
359
|
'xs': `--x-row-gap:4px;display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,4px) * -0.5);margin-right:calc(var(--x-row-gap,16px) * 0.5);`,
|
|
@@ -337,18 +368,18 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), { 'Color':
|
|
|
337
368
|
return `--x-col-width:${value.replace(/^-(\d)/, '$1')};padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5);box-sizing:border-box;flex:0 0 var(--x-col-width,${value.replace(/^-(\d)/, '$1')});max-width:var(--x-col-width,${value.replace(/^-(\d)/, '$1')});`;
|
|
338
369
|
},
|
|
339
370
|
groups: {
|
|
340
|
-
'1': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
341
|
-
'2': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
342
|
-
'3': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
343
|
-
'4': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
344
|
-
'5': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
345
|
-
'6': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
346
|
-
'7': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
347
|
-
'8': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
348
|
-
'9': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
349
|
-
'10': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
350
|
-
'11': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
351
|
-
'12': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0
|
|
371
|
+
'1': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 8.333%;max-width:8.333%;`,
|
|
372
|
+
'2': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 16.6667%;max-width:16.6667%;`,
|
|
373
|
+
'3': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 25%;max-width:25%;`,
|
|
374
|
+
'4': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 33.3333%;max-width:33.3333%;`,
|
|
375
|
+
'5': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 41.6667%;max-width:41.6667%;`,
|
|
376
|
+
'6': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 50%;max-width:50%;`,
|
|
377
|
+
'7': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 58.3333%;max-width:58.3333%;`,
|
|
378
|
+
'8': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 66.6667%;max-width:66.6667%;`,
|
|
379
|
+
'9': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 75%;max-width:75%;`,
|
|
380
|
+
'10': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 83.3333%;max-width:83.3333%;`,
|
|
381
|
+
'11': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 91.6667%;max-width:91.6667%;`,
|
|
382
|
+
'12': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 100%;max-width:100%;`,
|
|
352
383
|
},
|
|
353
384
|
},
|
|
354
385
|
// 'x-col-responsive':{
|
package/lib/prebuild.d.ts
CHANGED
|
@@ -1,129 +1,33 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
'x-
|
|
3
|
-
type: string;
|
|
4
|
-
statement: string;
|
|
5
|
-
};
|
|
6
|
-
'x-css-reset': {
|
|
7
|
-
type: string;
|
|
8
|
-
statement: string;
|
|
9
|
-
};
|
|
10
|
-
'x-css-reset-josh': {
|
|
11
|
-
type: string;
|
|
12
|
-
statement: string;
|
|
13
|
-
};
|
|
14
|
-
'x-css-reset-sanitize': {
|
|
15
|
-
type: string;
|
|
16
|
-
statement: string;
|
|
17
|
-
};
|
|
18
|
-
'x-css-reset-preflight': {
|
|
19
|
-
type: string;
|
|
20
|
-
statement: string;
|
|
21
|
-
};
|
|
22
|
-
'x-css-vars-color': {
|
|
23
|
-
type: string;
|
|
24
|
-
statement: string;
|
|
25
|
-
};
|
|
26
|
-
'x-css-vars-color-gray': {
|
|
27
|
-
type: string;
|
|
28
|
-
statement: string;
|
|
29
|
-
};
|
|
30
|
-
'x-css-vars-color-grayDark': {
|
|
31
|
-
type: string;
|
|
32
|
-
statement: string;
|
|
33
|
-
};
|
|
34
|
-
'x-css-vars-color-primary': {
|
|
35
|
-
type: string;
|
|
36
|
-
statement: string;
|
|
37
|
-
};
|
|
38
|
-
'x-css-vars-color-brand': {
|
|
39
|
-
type: string;
|
|
40
|
-
statement: string;
|
|
41
|
-
};
|
|
42
|
-
'x-css-vars-color-error': {
|
|
43
|
-
type: string;
|
|
44
|
-
statement: string;
|
|
45
|
-
};
|
|
46
|
-
'x-css-vars-color-success': {
|
|
47
|
-
type: string;
|
|
48
|
-
statement: string;
|
|
49
|
-
};
|
|
50
|
-
'x-css-vars-color-grayBlue': {
|
|
51
|
-
type: string;
|
|
52
|
-
statement: string;
|
|
53
|
-
};
|
|
54
|
-
'x-css-vars-color-grayNeural': {
|
|
55
|
-
type: string;
|
|
56
|
-
statement: string;
|
|
57
|
-
};
|
|
58
|
-
'x-css-vars-color-grayIron': {
|
|
59
|
-
type: string;
|
|
60
|
-
statement: string;
|
|
61
|
-
};
|
|
62
|
-
'x-css-vars-color-grayWarm': {
|
|
63
|
-
type: string;
|
|
64
|
-
statement: string;
|
|
65
|
-
};
|
|
66
|
-
'x-css-vars-color-greenLight': {
|
|
67
|
-
type: string;
|
|
68
|
-
statement: string;
|
|
69
|
-
};
|
|
70
|
-
'x-css-vars-color-green': {
|
|
71
|
-
type: string;
|
|
72
|
-
statement: string;
|
|
73
|
-
};
|
|
74
|
-
'x-css-vars-color-teal': {
|
|
75
|
-
type: string;
|
|
76
|
-
statement: string;
|
|
77
|
-
};
|
|
78
|
-
'x-css-vars-color-cyan': {
|
|
79
|
-
type: string;
|
|
80
|
-
statement: string;
|
|
81
|
-
};
|
|
82
|
-
'x-css-vars-color-blueLight': {
|
|
83
|
-
type: string;
|
|
84
|
-
statement: string;
|
|
85
|
-
};
|
|
86
|
-
'x-css-vars-color-blue': {
|
|
87
|
-
type: string;
|
|
88
|
-
statement: string;
|
|
89
|
-
};
|
|
90
|
-
'x-css-vars-color-blueDark': {
|
|
91
|
-
type: string;
|
|
92
|
-
statement: string;
|
|
93
|
-
};
|
|
94
|
-
'x-css-vars-color-indigo': {
|
|
95
|
-
type: string;
|
|
96
|
-
statement: string;
|
|
97
|
-
};
|
|
98
|
-
'x-css-vars-color-violet': {
|
|
2
|
+
'x-btn': {
|
|
99
3
|
type: string;
|
|
100
4
|
statement: string;
|
|
101
5
|
};
|
|
102
|
-
'x-
|
|
6
|
+
'x-button': {
|
|
103
7
|
type: string;
|
|
104
8
|
statement: string;
|
|
105
9
|
};
|
|
106
|
-
'x-
|
|
10
|
+
'x-input': {
|
|
107
11
|
type: string;
|
|
108
12
|
statement: string;
|
|
109
13
|
};
|
|
110
|
-
'x-css-
|
|
14
|
+
'x-css-reset-normalize': {
|
|
111
15
|
type: string;
|
|
112
16
|
statement: string;
|
|
113
17
|
};
|
|
114
|
-
'x-css-
|
|
18
|
+
'x-css-reset': {
|
|
115
19
|
type: string;
|
|
116
20
|
statement: string;
|
|
117
21
|
};
|
|
118
|
-
'x-css-
|
|
22
|
+
'x-css-reset-josh': {
|
|
119
23
|
type: string;
|
|
120
24
|
statement: string;
|
|
121
25
|
};
|
|
122
|
-
'x-css-
|
|
26
|
+
'x-css-reset-sanitize': {
|
|
123
27
|
type: string;
|
|
124
28
|
statement: string;
|
|
125
29
|
};
|
|
126
|
-
'x-css-
|
|
30
|
+
'x-css-reset-preflight': {
|
|
127
31
|
type: string;
|
|
128
32
|
statement: string;
|
|
129
33
|
};
|
|
@@ -143,14 +47,6 @@ declare const _default: {
|
|
|
143
47
|
type: string;
|
|
144
48
|
statement: string;
|
|
145
49
|
};
|
|
146
|
-
'x-button': {
|
|
147
|
-
type: string;
|
|
148
|
-
statement: string;
|
|
149
|
-
};
|
|
150
|
-
'x-input': {
|
|
151
|
-
type: string;
|
|
152
|
-
statement: string;
|
|
153
|
-
};
|
|
154
50
|
'x-arrow': {
|
|
155
51
|
type: string;
|
|
156
52
|
statement: string;
|