aliascss 1.1.10 → 1.1.12
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 +32 -6
- package/bin/aliascss.js +18 -12
- package/custom-compilers.js +32 -134
- package/dist/aliascss.js +1 -1
- package/lib/compilers/length.js +1 -1
- package/lib/css-properties-all.js +7 -1
- package/lib/node/compileFile.d.ts +3 -1
- package/lib/node/compileFile.js +16 -5
- package/lib/returnStatement.js +28 -2
- package/lib/static/customColorVariables.d.ts +3 -0
- package/lib/static/customColorVariables.js +376 -0
- package/lib/static/customStaticClassNames.js +1 -1
- package/old-custom-compilers.js +149 -0
- package/package.json +6 -5
- package/ts.js +21 -2
- package/ui/button.html +1 -1
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aliascss",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.12",
|
|
4
4
|
"description": "AliasCSS is a CSS post processor.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/Rodolopho/
|
|
24
|
+
"url": "git+https://github.com/Rodolopho/aliascss.git"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/jest": "^29.5.3",
|
|
@@ -49,14 +49,15 @@
|
|
|
49
49
|
"author": "Bikram Thapa",
|
|
50
50
|
"license": "MIT",
|
|
51
51
|
"bugs": {
|
|
52
|
-
"url": "https://github.com/Rodolopho/
|
|
52
|
+
"url": "https://github.com/Rodolopho/aliascss/issues"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"chokidar": "^3.6.0",
|
|
56
56
|
"cssnano": "^7.0.4",
|
|
57
57
|
"fast-glob": "^3.3.1",
|
|
58
58
|
"postcss": "^8.4.39",
|
|
59
|
-
"postcss-discard-duplicates": "^7.0.0"
|
|
59
|
+
"postcss-discard-duplicates": "^7.0.0",
|
|
60
|
+
"postcss-safe-parser": "^7.0.0"
|
|
60
61
|
},
|
|
61
|
-
"homepage": "https://github.com/Rodolopho/
|
|
62
|
+
"homepage": "https://github.com/Rodolopho/aliascss#readme"
|
|
62
63
|
}
|
package/ts.js
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import main ,{ watch} from './lib/node/compileFile.js'
|
|
2
|
+
import postcss from 'postcss';
|
|
3
|
+
|
|
2
4
|
import path from 'path'
|
|
5
|
+
import safeParse from 'postcss-safe-parser';
|
|
6
|
+
import * as fs from 'fs';
|
|
3
7
|
let config=await import(path.resolve('aliascss.config.js'))
|
|
4
|
-
console.log(
|
|
5
|
-
// watch({input:['./demo/**/*.html'],output:{location:'./demo/acss.css','--file':true}});
|
|
8
|
+
console.log(path.dirname('button/hello/hello.txt'));
|
|
9
|
+
// watch({input:['./demo/**/*.html'],output:{location:'./demo/acss.css','--file':true}});
|
|
10
|
+
// fs.openSync('button/hello/hello.txt','w');
|
|
11
|
+
|
|
12
|
+
// fs.mkdirSync('button/hello',{recursive:true})
|
|
13
|
+
|
|
14
|
+
let cpath="button/hello/hell0/s.js";
|
|
15
|
+
let dir=path.dirname(cpath);
|
|
16
|
+
if(fs.existsSync(dir)){
|
|
17
|
+
console.log('Already exists')
|
|
18
|
+
|
|
19
|
+
}else{
|
|
20
|
+
fs.mkdirSync(dir,{recursive:true});
|
|
21
|
+
|
|
22
|
+
console.log('Dir Created')
|
|
23
|
+
}
|
|
24
|
+
fs.openSync(cpath,'w');
|
package/ui/button.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
class-btn[--is(_.button[data-size-eql-2xl])&]="p16px-22px g-10px text-lg __.addon-h24px __.addon-w24px"
|
|
13
13
|
class-button[_.addon]="df bsbb w20px h20px br100p b-1d67px-solid">
|
|
14
14
|
<!-- Component -->
|
|
15
|
-
<button class="btn ">
|
|
15
|
+
<button class="btn" data-type="primary">
|
|
16
16
|
<!-- button-addon-rt -->
|
|
17
17
|
<span class="rt addon "></span>
|
|
18
18
|
<span class="">Button CTA</span>
|