aliascss 1.1.10 → 1.1.11
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/aliascss.config.js +20 -3
- package/custom-compilers.js +32 -134
- package/dist/aliascss.js +1 -1
- package/lib/compilers/length.js +1 -1
- package/lib/node/compileFile.d.ts +3 -1
- package/lib/node/compileFile.js +16 -5
- package/lib/returnStatement.js +28 -2
- package/old-custom-compilers.js +149 -0
- package/package.json +3 -2
- package/ts.js +21 -1
package/aliascss.config.js
CHANGED
|
@@ -83,12 +83,21 @@ const config={
|
|
|
83
83
|
'bg-dark':'background:#0f0f0f',
|
|
84
84
|
'flex-center':'display:flex;align-items:center;justify-content:center',
|
|
85
85
|
},
|
|
86
|
-
|
|
86
|
+
group:{
|
|
87
|
+
'responsive':'xs-w-100p sm-w-540px md-w-720px lg-w-960px xl-w-1140px xxl-w-1320px',
|
|
88
|
+
'responsive-sm':'xs-w-100p sm-w-540px md-w-720px lg-w-960px xl-w-1140px xxl-w-1320px',
|
|
89
|
+
'responsive-md':'xs-w-100p sm-w-100p md-w-720px lg-w-960px xl-w-1140px xxl-w-1320px',
|
|
90
|
+
'responsive-lg':'xs-w-100p sm-w-100p md-w-100p lg-w-960px xl-w-1140px xxl-w-1320px',
|
|
91
|
+
'responsive-xl':'xs-w-100p sm-w-100p md-w-100p lg-w-100p xl-w-1140px xxl-w-1320px',
|
|
92
|
+
'responsive-xll':'xs-w-100p sm-w-100p md-w-100p lg-w-100p xl-w-100p xxl-w-1320px',
|
|
93
|
+
'responsive-fluid':'xs-w-100p sm-w-100p md-w-100p lg-w-100p xl-100p xxl-100p',
|
|
94
|
+
},
|
|
95
|
+
statement:`.color{color:red}`,
|
|
87
96
|
ignore:['bgc-red']
|
|
88
97
|
}
|
|
89
98
|
export default config;
|
|
90
99
|
|
|
91
|
-
const xconfig= {
|
|
100
|
+
/* const xconfig= {
|
|
92
101
|
// input glob pattern or array of glob pattern
|
|
93
102
|
input:'public/*.html',
|
|
94
103
|
|
|
@@ -172,6 +181,12 @@ const xconfig= {
|
|
|
172
181
|
},
|
|
173
182
|
// predefine className
|
|
174
183
|
prebuild:{
|
|
184
|
+
//section
|
|
185
|
+
'text-xl': 'font-size:20px;line-height:30px',
|
|
186
|
+
'text-lg': 'font-size:18px;line-height:28px',
|
|
187
|
+
'text-md': 'font-size:16px;line-height:24px',
|
|
188
|
+
'text-sm': 'font-size:14px;line-height:20px',
|
|
189
|
+
'text-xs': 'font-size:12px;line-height:18px',
|
|
175
190
|
|
|
176
191
|
'text-xl': 'font-size:20px;line-height:30px',
|
|
177
192
|
'text-lg': 'font-size:18px;line-height:28px',
|
|
@@ -201,9 +216,11 @@ const xconfig= {
|
|
|
201
216
|
// pre group valid Aliascss classNames in single className
|
|
202
217
|
group:{
|
|
203
218
|
'container':' df fdc bsbb aic flex-shrink-1 flex-grow-1 ',
|
|
204
|
-
'section':'flex-shrink0 bsbb'
|
|
219
|
+
'section':'flex-shrink0 bsbb',
|
|
220
|
+
|
|
205
221
|
},
|
|
206
222
|
// if some of the className collide with other CSS framework like bootstrap and tailwindcss
|
|
207
223
|
// You wanna tell aliascss to ignore it...
|
|
208
224
|
ignore:['fs12px', 'c-red','bgc-red'],// these classnames will be ignored
|
|
209
225
|
}
|
|
226
|
+
*/
|
package/custom-compilers.js
CHANGED
|
@@ -1,149 +1,47 @@
|
|
|
1
1
|
import {getCompiler} from './lib/index.js'
|
|
2
2
|
export const compilers={
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
--space-4:16px;
|
|
11
|
-
--space-5:24px;
|
|
12
|
-
--space-6:32px;
|
|
13
|
-
--space-7:40px;
|
|
14
|
-
--space-8:48px;
|
|
15
|
-
--space-9:64px;
|
|
16
|
-
`,
|
|
17
|
-
theme:`
|
|
18
|
-
|
|
19
|
-
`
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
'Text':{
|
|
24
|
-
|
|
25
|
-
compiler:(value)=>{
|
|
26
|
-
let result='';
|
|
27
|
-
const match=/-([-]?[\w\.]+)/;
|
|
28
|
-
const property=['font-size','line-height','letter-spacing','font-weight'];
|
|
29
|
-
value.match(new RegExp(match,'g')).forEach((e,i)=>{
|
|
30
|
-
if(i<property.length){
|
|
31
|
-
result+=`${property[i]}:${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
return result;
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
groups:{
|
|
39
|
-
xs:'font-size:12px;line-height:18px;letter-spacing:0.0025em',
|
|
40
|
-
'1':'font-size:12px;letter-spacing:0.0025em;line-height:16px;',
|
|
41
|
-
'2':'font-size:14px;letter-spacing:0em;line-height:20px;',
|
|
42
|
-
'3':'font-size:16px;letter-spacing:0em;line-height:24px;',
|
|
43
|
-
'4':'font-size:18px;letter-spacing:-0.0025em;line-height:26px;',
|
|
44
|
-
'5':'font-size:20px;letter-spacing:-0.005em;line-height:28px;',
|
|
45
|
-
'6':'font-size:24px;letter-spacing:-0.00625em;line-height:30px;',
|
|
46
|
-
'7':'font-size:28px;letter-spacing:-0.0075em;line-height:36px;',
|
|
47
|
-
'8':'font-size:35px;letter-spacing:-0.01em;line-height:40px;',
|
|
48
|
-
'9':'font-size:60px;letter-spacing:-0.025em;line-height:60px;',
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
Box:{
|
|
54
|
-
compiler:(value)=>{
|
|
55
|
-
let result='';
|
|
56
|
-
const match=/-([-]?[\w\.]+)/;
|
|
57
|
-
const property=['width','height','padding'];
|
|
58
|
-
value.match(new RegExp(match,'g')).forEach((e,i)=>{
|
|
3
|
+
Box:{
|
|
4
|
+
type:'group',
|
|
5
|
+
compiler:(value)=>{
|
|
6
|
+
const property=['width','height','padding','margin'];
|
|
7
|
+
let result='display:block; ';
|
|
8
|
+
const match=/-([-]?[\w\.]+)/;
|
|
9
|
+
value.match(new RegExp(match,'g')).forEach((e,i)=>{
|
|
59
10
|
if(i<property.length){
|
|
60
11
|
result+=`${property[i]}:${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`;
|
|
61
12
|
}else{
|
|
62
|
-
|
|
63
13
|
result=result.replace(/;$/,` ${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`)
|
|
64
|
-
}
|
|
65
|
-
|
|
14
|
+
}
|
|
66
15
|
})
|
|
67
16
|
return result;
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
type:'group',
|
|
71
|
-
groups:{
|
|
72
|
-
|
|
73
|
-
}
|
|
74
17
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
18
|
+
},
|
|
19
|
+
'Flex-box':{
|
|
20
|
+
type:'group',
|
|
21
|
+
compiler:(value)=>{
|
|
22
|
+
const property=['flex-direction','justify-content','align-items','margin'];
|
|
23
|
+
let result='display:flex; ';
|
|
24
|
+
const match=/-([-]?[\w\.]+)/;
|
|
25
|
+
value.match(new RegExp(match,'g')).forEach((e,i)=>{
|
|
82
26
|
if(i<property.length){
|
|
83
27
|
result+=`${property[i]}:${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return result;
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
type:'group',
|
|
91
|
-
groups:{
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
Colorize:{
|
|
96
|
-
'alias':'pos',
|
|
97
|
-
compiler:(value,custom)=>{
|
|
98
|
-
let result='';
|
|
99
|
-
const match=/-([-]?[\w\.]+)/;
|
|
100
|
-
const property=['background-color','border-color','color',];
|
|
101
|
-
value.match(new RegExp(match,'g')).forEach((e,i)=>{
|
|
102
|
-
|
|
103
|
-
if(i<property.length){
|
|
104
|
-
if(e.match(/^--[a-zA-Z]/)){
|
|
105
|
-
result+=`${property[i]}:var(${e});`
|
|
106
|
-
}else{
|
|
107
|
-
result+=`${property[i]}:${getCompiler('color').compiler(e,custom)};`;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
28
|
+
}else{
|
|
29
|
+
result=result.replace(/;$/,` ${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`)
|
|
30
|
+
}
|
|
111
31
|
})
|
|
112
32
|
return result;
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
type:'group',
|
|
116
|
-
groups:{
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
Container:{
|
|
121
|
-
type:"group",
|
|
122
|
-
compiler:(value)=>value,
|
|
123
|
-
groups:{
|
|
124
|
-
'1':'display:block;margin:auto;width:var(--container-1,448px)',
|
|
125
|
-
'2':'display:block;margin:auto;width:var(--container-2,688px)',
|
|
126
|
-
'3':'display:block;margin:auto;width:var(--container-3,880px)',
|
|
127
|
-
'4':'display:block;margin:auto;width:var(--container-4,1136px)',
|
|
128
|
-
'xs':'display:block;margin:auto;width:var(--container-xs,448px)',
|
|
129
|
-
'sm':'display:block;margin:auto;width:var(--container-sm,688px)',
|
|
130
|
-
'md':'display:block;margin:auto;width:var(--container-md,880px)',
|
|
131
|
-
'lg':'display:block;margin:auto;width:var(--container-lg,1136px)',
|
|
132
|
-
}
|
|
133
33
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
compiler:(value)=>value,
|
|
137
|
-
groups:{
|
|
138
|
-
'1':'display:block;padding:var(--section-padding-1,24px) auto',
|
|
139
|
-
'2':'display:block;padding:var(--section-padding-2,40px) auto',
|
|
140
|
-
'3':'display:block;padding:var(--section-padding-3,64px) auto',
|
|
141
|
-
'4':'display:block;padding:var(--section-padding-4,80px) auto',
|
|
142
|
-
'xs':'display:block;padding:var(--section-padding-xs,24px) auto',
|
|
143
|
-
'sm':'display:block;padding:var(--section-padding-sm,40px) auto',
|
|
144
|
-
'md':'display:block;padding:var(--section-padding-md,64px) auto',
|
|
145
|
-
'lg':'display:block;padding:var(--section-padding-lg,80px) auto',
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
}
|
|
34
|
+
},
|
|
35
|
+
|
|
149
36
|
}
|
|
37
|
+
|
|
38
|
+
//Grid-box
|
|
39
|
+
//Flex-child
|
|
40
|
+
//Grid-child
|
|
41
|
+
//Color
|
|
42
|
+
//Container
|
|
43
|
+
//Section
|
|
44
|
+
//Text-size-lineHeight-letterSpacing-decoration
|
|
45
|
+
//Border-borderWidth-borderStyle-Border-color-borderRadius
|
|
46
|
+
//List
|
|
47
|
+
//Table
|