aliascss 1.2.4 → 1.2.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 +24 -33
- package/dist/aliascss.js +1 -1
- package/lib/classPrinter.js +7 -1
- package/lib/compilers/shadow.js +2 -0
- package/lib/css-properties-all.js +28 -28
- package/lib/custom-css-compilers.js +95 -30
- package/lib/node/compileFile.js +8 -8
- package/lib/prebuild.d.ts +4 -116
- package/lib/prebuild.js +69 -116
- package/lib/prefix/responsive.js +13 -4
- package/lib/returnPropertyAndValue.js +2 -2
- package/lib/returnStatement.js +2 -1
- package/lib/static/customColorsRadix.d.ts +3540 -0
- package/lib/static/customColorsRadix.js +3797 -0
- package/lib/static/customStaticClassNames.js +22 -12
- package/lib/utils/helper.d.ts +5 -0
- package/lib/utils/helper.js +19 -0
- package/package.json +2 -2
- package/ts.js +22 -10
|
@@ -84,14 +84,14 @@ export const customStaticClassNames = {
|
|
|
84
84
|
'x-fixed-center': "position:fixed;margin:auto;top:0;left:0;right:0;bottom:0;",
|
|
85
85
|
'x-sr-only': 'position:absolute;overflow:hidden;clip-path:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0',
|
|
86
86
|
'x-display-2xl': 'font-size:72px ; line-height:90px ; letter-spacing:-0.02em',
|
|
87
|
-
'x-display-xxl': 'font-size:72px ; line-height:90px ; letter-spacing:-0.02em',
|
|
87
|
+
// 'x-display-xxl': 'font-size:72px ; line-height:90px ; letter-spacing:-0.02em',
|
|
88
88
|
'x-display-xl': 'font-size: 60px; line-height: 72px; letter-spacing:-0.02em',
|
|
89
89
|
'x-display-lg': 'font-size:48px ; line-height: 60px; letter-spacing:-0.02em',
|
|
90
90
|
'x-display-md': 'font-size: 36px; line-height: 44px; letter-spacing:-0.02em',
|
|
91
91
|
'x-display-sm': 'font-size: 30px; line-height: 38px',
|
|
92
92
|
'x-display-xs': 'font-size: 24px; line-height: 32px',
|
|
93
93
|
'x-heading-2xl': 'font-size:72px ; line-height:90px ; letter-spacing:-0.02em',
|
|
94
|
-
'x-heading-xxl': 'font-size:72px ; line-height:90px ; letter-spacing:-0.02em',
|
|
94
|
+
// 'x-heading-xxl': 'font-size:72px ; line-height:90px ; letter-spacing:-0.02em',
|
|
95
95
|
'x-heading-xl': 'font-size: 60px; line-height: 72px; letter-spacing:-0.02em',
|
|
96
96
|
'x-heading-lg': 'font-size:48px ; line-height: 60px; letter-spacing:-0.02em',
|
|
97
97
|
'x-heading-md': 'font-size: 36px; line-height: 44px; letter-spacing:-0.02em',
|
|
@@ -114,17 +114,24 @@ export const customStaticClassNames = {
|
|
|
114
114
|
'x-t-md': 'font-size:16px;line-height:24px',
|
|
115
115
|
'x-t-sm': 'font-size:14px;line-height:20px',
|
|
116
116
|
'x-t-xs': 'font-size:12px;line-height:18px',
|
|
117
|
-
'x-button-xxl':
|
|
118
|
-
|
|
119
|
-
'x-button-
|
|
120
|
-
'
|
|
121
|
-
'x-button-
|
|
122
|
-
'
|
|
123
|
-
'x-button-
|
|
117
|
+
// 'x-button-xxl':
|
|
118
|
+
// 'display:inline-flex;justify-content:center;align-items:center;gap:8px;padding:16px 28px;border-radius:8px;box-sizing:border-box',
|
|
119
|
+
// 'x-button-2xl':
|
|
120
|
+
// 'display:inline-flex;justify-content:center;align-items:center;gap:8px;padding:16px 28px;border-radius:8px;box-sizing:border-box',
|
|
121
|
+
// 'x-button-xl':
|
|
122
|
+
// 'display:inline-flex;justify-content:center;align-items:center;gap:8px;padding:12px 20px;border-radius:8px;box-sizing:border-box',
|
|
123
|
+
// 'x-button-lg':
|
|
124
|
+
// 'display:inline-flex;justify-content:center;align-items:center;gap:8px;padding:10px 18px;border-radius:8px;box-sizing:border-box',
|
|
125
|
+
// 'x-button-md':
|
|
126
|
+
// 'display:inline-flex;justify-content:center;align-items:center;gap:8px;padding:10px 16px;border-radius:8px;box-sizing:border-box',
|
|
127
|
+
// 'x-button-sm':
|
|
128
|
+
// 'display:inline-flex;justify-content:center;align-items:center;gap:8px;padding:8px 14px;border-radius:8px;box-sizing:border-box',
|
|
129
|
+
// 'x-button-xs':
|
|
130
|
+
// 'display:inline-flex;justify-content:center;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;box-sizing:border-box',
|
|
124
131
|
'x-shadow-3xl': 'box-shadow:var(--x-shadow-3xl, 0px 32px 64px -12px rgba(16, 24, 40, 0.14))',
|
|
125
|
-
'x-shadow-xxxl': 'box-shadow:var(--x-shadow-xxxl, 0px 32px 64px -12px rgba(16, 24, 40, 0.14))',
|
|
132
|
+
// 'x-shadow-xxxl': 'box-shadow:var(--x-shadow-xxxl, 0px 32px 64px -12px rgba(16, 24, 40, 0.14))',
|
|
126
133
|
'x-shadow-2xl': 'box-shadow:var(--x-shadow-2xl, 0px 24px 48px -12px rgba(16, 24, 40, 0.18))',
|
|
127
|
-
'x-shadow-xxl': 'box-shadow:var(--x-shadow-xxl, 0px 24px 48px -12px rgba(16, 24, 40, 0.18))',
|
|
134
|
+
// 'x-shadow-xxl': 'box-shadow:var(--x-shadow-xxl, 0px 24px 48px -12px rgba(16, 24, 40, 0.18))',
|
|
128
135
|
'x-shadow-xl': 'box-shadow:var(--x-shadow-xl, 0px 20px 24px -4px rgba(16, 24, 40, 0.08), 0px 8px 8px -4px rgba(16, 24, 40, 0.03))',
|
|
129
136
|
'x-shadow-lg': 'box-shadow:var(--x-shadow-lg, 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03))',
|
|
130
137
|
'x-shadow-md': 'box-shadow:var(--x-shadow-md, 0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06))',
|
|
@@ -145,13 +152,14 @@ export const customStaticClassNames = {
|
|
|
145
152
|
'x-blur-lg': 'backdrop-filter: var(--x-blur-lg,blur(12px))',
|
|
146
153
|
'x-blur-xl': 'backdrop-filter: var(--x-blur-xl,blur(20px))',
|
|
147
154
|
'x-colorize-dark': 'background:#0f0f0f;color:#e3e3e3',
|
|
155
|
+
'x-colorize-light': 'background:#e3e3e3;color:rgba(0,0,0,0.8)',
|
|
148
156
|
'x-clip-menu': 'clip-path: polygon(0% 10%,100% 10%,100% 20%,0% 20%,0% 45%,100% 45%,100% 55%,0% 55%,0% 80%,100% 80%,100% 90%,0% 90%);',
|
|
149
157
|
'x-clip-message': 'clip-path: polygon(0% 0%,100% 0%,100% 80%,60% 80%,50% 100%,40% 80%,0% 80%);',
|
|
150
158
|
'x-clip-star': 'clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);',
|
|
151
159
|
'x-clip-close': 'clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%)',
|
|
152
160
|
'x-clip-plus': 'clip-path: polygon(40% 0%,60% 0%,60% 40%,100% 40%,100% 60%,60% 60%,60% 100%,40% 100%,40% 60%,0% 60%,0% 40%,40% 40%);',
|
|
153
|
-
'x-colorize-light': 'background:#e3e3e3;color:rgba(0,0,0,0.8)',
|
|
154
161
|
'flex-center': 'display:flex;align-items:center;justify-content:center',
|
|
162
|
+
'inline-flex-center': 'display:inline-flex;align-items:center;justify-content:center',
|
|
155
163
|
'absolute-center': 'position:absolute;top:0;right:0;left:0;bottom:0:margin:auto',
|
|
156
164
|
'sr-only': 'position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0',
|
|
157
165
|
'hidden': 'display:none',
|
|
@@ -190,5 +198,7 @@ export const customStaticClassNames = {
|
|
|
190
198
|
'x-relative': 'position:relative',
|
|
191
199
|
'x-jusitfy-between': 'justify-content: space-between',
|
|
192
200
|
'x-flex': 'display:flex',
|
|
201
|
+
'x-flex-between': 'display:flex;align-items:center;justify-content:space-between',
|
|
202
|
+
'flex-between': 'display:flex;align-items:center;justify-content:space-between',
|
|
193
203
|
'x-items-center': 'align-items: center'
|
|
194
204
|
};
|
package/lib/utils/helper.d.ts
CHANGED
package/lib/utils/helper.js
CHANGED
|
@@ -25,3 +25,22 @@ export function splitByCommaOutsideParens(str) {
|
|
|
25
25
|
}
|
|
26
26
|
return result;
|
|
27
27
|
}
|
|
28
|
+
export function cssVarWithDefault(valuePortion, compiler, custom = {}) {
|
|
29
|
+
if (/^--[a-zA-Z]/.test(valuePortion)) {
|
|
30
|
+
if (valuePortion.includes(':')) {
|
|
31
|
+
const value = valuePortion.slice(valuePortion.indexOf(':')).replace(':', '');
|
|
32
|
+
const cssVar = valuePortion.replace(value, '').replace(':', '');
|
|
33
|
+
if (/^calc\(/.test(value)) {
|
|
34
|
+
return "var(" + cssVar + ',' + value.replace(/([-+/*])([\d]|var\(|calc\()/g, ' $1 $2') + ')';
|
|
35
|
+
}
|
|
36
|
+
if (compiler) {
|
|
37
|
+
const val = compiler(value, custom);
|
|
38
|
+
return `var(${cssVar}, ${val ? val : value})`;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return `var(${cssVar}, ${value.replace(/([\d])p$/g, '$1%')})`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return `var(${valuePortion})`;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aliascss",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "AliasCSS is a CSS post processor.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"postcss-discard-duplicates": "^7.0.0",
|
|
63
63
|
"postcss-safe-parser": "^7.0.0"
|
|
64
64
|
},
|
|
65
|
-
"homepage": "https://
|
|
65
|
+
"homepage": "https://aliascss.com"
|
|
66
66
|
}
|
package/ts.js
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
import main ,{ watch} from './lib/node/compileFile.js'
|
|
2
2
|
import postcss from 'postcss';
|
|
3
|
+
import { customColorsRadix,getColorScale ,colors} from './lib/static/customColorsRadix.js';
|
|
3
4
|
|
|
4
5
|
import path from 'path'
|
|
5
6
|
import safeParse from 'postcss-safe-parser';
|
|
6
7
|
import * as fs from 'fs';
|
|
7
8
|
let config=await import(path.resolve('aliascss.config.js'))
|
|
8
|
-
console.log(path.dirname('button/hello/hello.txt'));
|
|
9
|
+
// console.log(path.dirname('button/hello/hello.txt'));
|
|
9
10
|
// watch({input:['./demo/**/*.html'],output:{location:'./demo/acss.css','--file':true}});
|
|
10
11
|
// fs.openSync('button/hello/hello.txt','w');
|
|
11
12
|
|
|
12
13
|
// fs.mkdirSync('button/hello',{recursive:true})
|
|
13
14
|
|
|
14
|
-
let cpath="button/hello/hell0/s.js";
|
|
15
|
-
let dir=path.dirname(cpath);
|
|
16
|
-
if(fs.existsSync(dir)){
|
|
17
|
-
|
|
15
|
+
// let cpath="button/hello/hell0/s.js";
|
|
16
|
+
// let dir=path.dirname(cpath);
|
|
17
|
+
// if(fs.existsSync(dir)){
|
|
18
|
+
// console.log('Already exists')
|
|
18
19
|
|
|
19
|
-
}else{
|
|
20
|
-
|
|
20
|
+
// }else{
|
|
21
|
+
// fs.mkdirSync(dir,{recursive:true});
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
fs.openSync(cpath,'w');
|
|
23
|
+
// console.log('Dir Created')
|
|
24
|
+
// }
|
|
25
|
+
// fs.openSync(cpath,'w');
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
`
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
`
|