aliascss 1.1.3 → 1.1.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/aliascss.config.js +4 -2
- package/custom-compilers.js +149 -0
- package/dist/aliascss.js +1 -1
- package/lib/node/extractClassNamesFromFile.js +1 -1
- package/lib/returnPropertyAndValue.js +12 -1
- package/lib/utils/createCompilerObj.d.ts +3 -0
- package/lib/utils/createCompilerObj.js +6 -1
- package/package.json +1 -1
- package/ui/button.html +23 -51
- package/ui/buttonold.html +53 -0
package/aliascss.config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {getCompiler} from './lib/index.js'
|
|
1
|
+
import {getCompiler,main} from './lib/index.js'
|
|
2
|
+
import { compilers } from './custom-compilers.js';
|
|
2
3
|
const config={
|
|
3
4
|
input:['demo/**/*.html'],
|
|
4
5
|
output:{
|
|
@@ -17,6 +18,8 @@ const config={
|
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
extend:{
|
|
21
|
+
// Note property cannot include uppercase/number character but first character uppercase allowed
|
|
22
|
+
...compilers,
|
|
20
23
|
'txt-shadow':{
|
|
21
24
|
property:'--webkit-text-shadow',
|
|
22
25
|
compiler:(value)=>value
|
|
@@ -74,7 +77,6 @@ const config={
|
|
|
74
77
|
white:'#e3e3e3',
|
|
75
78
|
'whiter':'#f3f3f3',
|
|
76
79
|
whitest:'#ffffff',
|
|
77
|
-
primary700:'red'
|
|
78
80
|
}
|
|
79
81
|
},
|
|
80
82
|
prebuild:{
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {getCompiler} from './lib/index.js'
|
|
2
|
+
export const compilers={
|
|
3
|
+
'import-var':{
|
|
4
|
+
type:'group',
|
|
5
|
+
groups:{
|
|
6
|
+
'spacing':`
|
|
7
|
+
--space-1:4px;
|
|
8
|
+
--space-2:8px;
|
|
9
|
+
--space-3:12px;
|
|
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)=>{
|
|
59
|
+
if(i<property.length){
|
|
60
|
+
result+=`${property[i]}:${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`;
|
|
61
|
+
}else{
|
|
62
|
+
|
|
63
|
+
result=result.replace(/;$/,` ${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
})
|
|
67
|
+
return result;
|
|
68
|
+
|
|
69
|
+
},
|
|
70
|
+
type:'group',
|
|
71
|
+
groups:{
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
Position:{
|
|
76
|
+
'alias':'pos',
|
|
77
|
+
compiler:(value)=>{
|
|
78
|
+
let result='';
|
|
79
|
+
const match=/-([-]?[\w\.]+)/;
|
|
80
|
+
const property=['position','top','right','bottom','left'];
|
|
81
|
+
value.match(new RegExp(match,'g')).forEach((e,i)=>{
|
|
82
|
+
if(i<property.length){
|
|
83
|
+
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
|
+
|
|
111
|
+
})
|
|
112
|
+
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
|
+
},
|
|
134
|
+
Section:{
|
|
135
|
+
type:"group",
|
|
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
|
+
}
|
|
149
|
+
}
|