aliascss 1.1.0
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/.prettierrc +5 -0
- package/LICENSE +21 -0
- package/README.md +544 -0
- package/READMEEdititng.md +615 -0
- package/aliascss.config.js +201 -0
- package/bin/aliascss.js +101 -0
- package/dist/aliascss.js +1 -0
- package/jestconfig.json +10 -0
- package/lib/build/index.d.ts +1 -0
- package/lib/build/index.js +63 -0
- package/lib/classPrinter.d.ts +6 -0
- package/lib/classPrinter.js +233 -0
- package/lib/compilers/border.d.ts +5 -0
- package/lib/compilers/border.js +50 -0
- package/lib/compilers/clipPath.d.ts +5 -0
- package/lib/compilers/clipPath.js +57 -0
- package/lib/compilers/color.d.ts +5 -0
- package/lib/compilers/color.js +61 -0
- package/lib/compilers/filter.d.ts +7 -0
- package/lib/compilers/filter.js +54 -0
- package/lib/compilers/font.d.ts +5 -0
- package/lib/compilers/font.js +19 -0
- package/lib/compilers/gradient.d.ts +5 -0
- package/lib/compilers/gradient.js +138 -0
- package/lib/compilers/length.d.ts +2 -0
- package/lib/compilers/length.js +10 -0
- package/lib/compilers/shadow.d.ts +5 -0
- package/lib/compilers/shadow.js +55 -0
- package/lib/compilers/stringAndContent.d.ts +6 -0
- package/lib/compilers/stringAndContent.js +23 -0
- package/lib/compilers/timingFunction.d.ts +5 -0
- package/lib/compilers/timingFunction.js +35 -0
- package/lib/compilers/transform.d.ts +2 -0
- package/lib/compilers/transform.js +117 -0
- package/lib/compilers/transition.d.ts +1 -0
- package/lib/compilers/transition.js +35 -0
- package/lib/compilers/url.d.ts +1 -0
- package/lib/compilers/url.js +33 -0
- package/lib/config.d.ts +20 -0
- package/lib/config.js +21 -0
- package/lib/css-properties-all.d.ts +16 -0
- package/lib/css-properties-all.js +2642 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +7 -0
- package/lib/node/compileFile.d.ts +25 -0
- package/lib/node/compileFile.js +337 -0
- package/lib/node/extractClassNamesFromFile.d.ts +18 -0
- package/lib/node/extractClassNamesFromFile.js +105 -0
- package/lib/prefix/PseudoPrefix.d.ts +7 -0
- package/lib/prefix/PseudoPrefix.js +145 -0
- package/lib/prefix/attribute-selector.d.ts +5 -0
- package/lib/prefix/attribute-selector.js +14 -0
- package/lib/prefix/colonToDefaultConversion.d.ts +1 -0
- package/lib/prefix/colonToDefaultConversion.js +3 -0
- package/lib/prefix/element-selector.d.ts +5 -0
- package/lib/prefix/element-selector.js +25 -0
- package/lib/prefix/extractMediaPrefix.d.ts +3 -0
- package/lib/prefix/extractMediaPrefix.js +12 -0
- package/lib/prefix/extractPrefix.d.ts +1 -0
- package/lib/prefix/extractPrefix.js +66 -0
- package/lib/prefix/pseudoSelector.d.ts +1 -0
- package/lib/prefix/pseudoSelector.js +48 -0
- package/lib/prefix/pseudoSelectorNew.d.ts +1 -0
- package/lib/prefix/pseudoSelectorNew.js +78 -0
- package/lib/prefix/responsive.d.ts +10 -0
- package/lib/prefix/responsive.js +26 -0
- package/lib/returnPropertyAndValue.d.ts +8 -0
- package/lib/returnPropertyAndValue.js +42 -0
- package/lib/returnStatement.d.ts +5 -0
- package/lib/returnStatement.js +189 -0
- package/lib/static/customColors.d.ts +3 -0
- package/lib/static/customColors.js +376 -0
- package/lib/static/customStaticClassNames.d.ts +3 -0
- package/lib/static/customStaticClassNames.js +132 -0
- package/lib/static/staticClassNamesAlias.d.ts +3 -0
- package/lib/static/staticClassNamesAlias.js +1300 -0
- package/lib/utils/createCompilerObj.d.ts +35 -0
- package/lib/utils/createCompilerObj.js +97 -0
- package/lib/utils/cssFunc.d.ts +1 -0
- package/lib/utils/cssFunc.js +27 -0
- package/package.json +64 -0
- package/ts.js +5 -0
- package/tsconfig.json +14 -0
- package/tslint.json +9 -0
- package/webpack.config.js +11 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default function length(data) {
|
|
2
|
+
return data.replace(/[-]?fit-content-([-]?\w+)/g, ' fit-content( $1 )')
|
|
3
|
+
.replace(/[-]([-]?[0-9])/g, ' $1').replace(/([\d])d([\d])/, '$1.$2').replace(/-auto/g, ' auto')
|
|
4
|
+
.replace(/([\d])p[\s]/g, "$1% ").replace(/([\d])p$/, "$1%").replace(/-(f|m)/g, '$1');
|
|
5
|
+
}
|
|
6
|
+
export const lenByNumPer = (value) => value.replace(/[-]([-]?[\w])/g, ' $1').replace(/([\d])d([\d])/g, '$1.$2').replace(/([\d])p[\s]/g, "$1% ").replace(/([\d])p$/, "$1%").replace(/[\s]by[\s]/g, ' / ').replace(/auto flow/g, 'auto-flow');
|
|
7
|
+
// const lenNumPer=(value:string)=>value.replace(/[-]([-]?[\w])/g,' $1').replace(/([\d])d([\d])/g,'$1.$2').replace(/([\d])p[\s]/g,"$1% ").replace(/([\d])p$/,"$1%").replace(/([a-z])([\d-])/g,'$1 $2');
|
|
8
|
+
// const signedLenNumPer=(value:string)=>value.replace(/([\d])d([\d])/g,'$1.$2').replace(/([a-z])([\d-])/g,'$1 $2').replace(/([\d])p[\s]/g,"$1% ").replace(/([\d])p$/,"$1%").replace(/[-]([a-z])/g,'$1');
|
|
9
|
+
// const lenByNumPer=(value:string)=>value.replace(/[-]([-]?[\w])/g,' $1').replace(/([\d])d([\d])/g,'$1.$2').replace(/([\d])p[\s]/g,"$1% ").replace(/([\d])p$/,"$1%").replace(/[\s]by[\s]/g,' / ');
|
|
10
|
+
// const lenFitContent=(value:string)=>value.replace(/fit-content-([-]?\w+)/,'fit-content( $1 )').replace(/[-]([-]?[\w])/g,' $1').replace(/([\d])d([\d])/g,' $1.$2 ').replace(/([\d])p[\s]/g,"$1% ").replace(/([\d])p$/,"$1%");
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import color from './color.js';
|
|
2
|
+
export default function shadow(data, custom) {
|
|
3
|
+
let compileValue = '';
|
|
4
|
+
data.split(/__/).forEach((e) => {
|
|
5
|
+
let eachValue = ' ';
|
|
6
|
+
let len = '';
|
|
7
|
+
const col = '';
|
|
8
|
+
if (e.match(/^[-]?(i|inset)/)) {
|
|
9
|
+
eachValue += 'inset ';
|
|
10
|
+
e = e.replace(/^[-]?(inset|i)/, '');
|
|
11
|
+
}
|
|
12
|
+
// fix Zero
|
|
13
|
+
e = e.replace(/(?<=-)0(?=-)/g, '0px').replace(/([-][0-9pd]{6,})/, (a) => a.replace(/p/g, 'xer'));
|
|
14
|
+
const match = e.match(/([-]?[-]?[0-9]{1,3}[d/.]?[0-9]*(px|em|p|fr|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))+/);
|
|
15
|
+
if (match) {
|
|
16
|
+
len = match[0];
|
|
17
|
+
e = e.replace(len, '');
|
|
18
|
+
}
|
|
19
|
+
if (len) {
|
|
20
|
+
// eachValue+=len.replace(/-0px-/g,'-0-').replace(/[-]([-]?[\d])/g,' $1').trim()+" ";
|
|
21
|
+
eachValue += len.replace(/[-]([-]?[\d])/g, ' $1').trim() + " ";
|
|
22
|
+
const col = color(e.replace(/xer/g, 'p'), custom);
|
|
23
|
+
if (col) {
|
|
24
|
+
eachValue += col + " ";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
compileValue += eachValue + ",";
|
|
28
|
+
// search for length /()/
|
|
29
|
+
});
|
|
30
|
+
return compileValue.replace(/[,]$/, '').trim();
|
|
31
|
+
}
|
|
32
|
+
const ref = `/* Keyword values */
|
|
33
|
+
box-shadow: none;
|
|
34
|
+
|
|
35
|
+
/* A color and two length values */
|
|
36
|
+
/* <color> | <length> | <length> */
|
|
37
|
+
box-shadow: red 60px -16px;
|
|
38
|
+
|
|
39
|
+
/* Three length values and a color */
|
|
40
|
+
/* <length> | <length> | <length> | <color> */
|
|
41
|
+
box-shadow: 10px 5px 5px black;
|
|
42
|
+
|
|
43
|
+
/* Four length values and a color */
|
|
44
|
+
/* <length> | <length> | <length> | <length> | <color> */
|
|
45
|
+
box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 20%);
|
|
46
|
+
|
|
47
|
+
/* inset, length values, and a color */
|
|
48
|
+
/* <inset> | <length> | <length> | <color> */
|
|
49
|
+
box-shadow: inset 5em 1em gold;
|
|
50
|
+
|
|
51
|
+
/* Any number of shadows, separated by commas */
|
|
52
|
+
box-shadow:
|
|
53
|
+
3px 3px red inset,
|
|
54
|
+
-1em 0 0.4em olive;
|
|
55
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function string(str, custom) {
|
|
2
|
+
// return string as it is only changes __ to ,
|
|
3
|
+
return str.replace(/^[-]/, '').replace(/__/g, ', ');
|
|
4
|
+
}
|
|
5
|
+
export default function content(str) {
|
|
6
|
+
// for CSS entities
|
|
7
|
+
if (str.match(/^_/)) {
|
|
8
|
+
return "'" + str.replace('_', ' \\') + "'";
|
|
9
|
+
}
|
|
10
|
+
str = str.replace(/^[-]/, '');
|
|
11
|
+
// attr() or counter()
|
|
12
|
+
const data = str.match(/^(attr|counter)?[-_]([\w-]+)/);
|
|
13
|
+
if (data) {
|
|
14
|
+
if (data[1] === 'attr') {
|
|
15
|
+
return 'attr(' + data[2] + ')';
|
|
16
|
+
}
|
|
17
|
+
if (data[1] === 'counter') {
|
|
18
|
+
return 'counter(' + data[2] + ')';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// return plain string with quotes
|
|
22
|
+
return '"' + str.replace(/[_]/g, ' ') + '"';
|
|
23
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default function timingFunction(data, custom) {
|
|
2
|
+
data = data.replace(/^[-_]/, '');
|
|
3
|
+
const func = {
|
|
4
|
+
e: 'ease',
|
|
5
|
+
ease: 'ease',
|
|
6
|
+
linear: 'linear',
|
|
7
|
+
l: 'linear',
|
|
8
|
+
ei: 'ease-in',
|
|
9
|
+
'ease-in': 'ease-in',
|
|
10
|
+
eo: 'ease-out',
|
|
11
|
+
'ease-out': 'ease-out',
|
|
12
|
+
eio: 'ease-in-out',
|
|
13
|
+
'ease-in-out': 'ease-in-out',
|
|
14
|
+
ss: 'step-start',
|
|
15
|
+
'step-start': 'step-start',
|
|
16
|
+
se: 'step-end',
|
|
17
|
+
'step-end': 'step-end',
|
|
18
|
+
};
|
|
19
|
+
let result = '';
|
|
20
|
+
const test1 = /(cubic-bezier|cb)(([-_][-]?[0-9][d]?[0-9]?){4})/;
|
|
21
|
+
const test2 = /(steps|s)[-_]([0-9]+)[-]((jump)?[-]?(start|end|none|both))/;
|
|
22
|
+
data.split('__').forEach((e) => {
|
|
23
|
+
if (test1.test(e)) {
|
|
24
|
+
result = result + e.replace(test1, (e, f, g) => 'cubic-bezier' + "(" + g.replace(/-/, "").replace(/--/g, '-Minus').replace(/-/g, ", ").replace(/d/g, ".").replace(/Minus/g, '-') + ")") + ", ";
|
|
25
|
+
}
|
|
26
|
+
else if (test2.test(e)) {
|
|
27
|
+
result = result + e.replace(test2, (e, f, g, h) => "steps" + "(" + g + ", " + h + ")") + ", ";
|
|
28
|
+
}
|
|
29
|
+
else if (/^(e|ease|l|linear|ei|ease-in|eo|ease-out|eio|ease-in-out|ss|step-start|se|step-end)$/.test(e)) {
|
|
30
|
+
result = result + func[e] + ", ";
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
if (result.trim())
|
|
34
|
+
return result.trim().replace(/[,]$/, '');
|
|
35
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export default (value) => {
|
|
2
|
+
// Remove - before value
|
|
3
|
+
value = value.replace(/^-/, '');
|
|
4
|
+
// initialize compilerValue
|
|
5
|
+
let compileValue = '';
|
|
6
|
+
// check for multiple value
|
|
7
|
+
value.split(/__(?=[a-z])/).forEach((e) => {
|
|
8
|
+
// extract function
|
|
9
|
+
const result = transformEach(e);
|
|
10
|
+
if (result)
|
|
11
|
+
compileValue += result + " ";
|
|
12
|
+
});
|
|
13
|
+
if (compileValue.trim())
|
|
14
|
+
return compileValue.trim();
|
|
15
|
+
};
|
|
16
|
+
function transformEach(data) {
|
|
17
|
+
if (data.match(/--[a-z]/)) {
|
|
18
|
+
const [func, cssVar] = data.split('--');
|
|
19
|
+
if (tfAlias.hasOwnProperty(func))
|
|
20
|
+
return `${tfAlias[func]}(var(--${cssVar}))`;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const match = /([a-zA-z]+(3d)?)(([-]?[-]?[0-9]+[d]?[0-9]*[a-z]*))+/;
|
|
24
|
+
const exfunc = data.match(match);
|
|
25
|
+
let func = null;
|
|
26
|
+
if (exfunc) {
|
|
27
|
+
func = exfunc[1];
|
|
28
|
+
}
|
|
29
|
+
if (!func)
|
|
30
|
+
return;
|
|
31
|
+
let statement = '';
|
|
32
|
+
if (tfAlias.hasOwnProperty(func)) {
|
|
33
|
+
statement += tfAlias[func] + '(';
|
|
34
|
+
statement +=
|
|
35
|
+
data
|
|
36
|
+
.replace(func, '').replace(/--/g, '-Minus').replace(/^-/, '')
|
|
37
|
+
.replace(/-/g, ', ').replace(/Minus/g, '-')
|
|
38
|
+
.replace(/(?<=[0-9])[d](?=[0-9])/g, '.')
|
|
39
|
+
.replace(/(?<=[0-9])[p](?=[\s|,])/g, '%')
|
|
40
|
+
.replace(/p$/, '%') + ')';
|
|
41
|
+
return statement;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const tfAlias = {
|
|
48
|
+
m: 'matrix',
|
|
49
|
+
matrix: 'matrix',
|
|
50
|
+
t: 'translate',
|
|
51
|
+
translate: 'translate',
|
|
52
|
+
tx: 'translateX',
|
|
53
|
+
translateX: 'translateX',
|
|
54
|
+
ty: 'translateY',
|
|
55
|
+
translateY: 'translateY',
|
|
56
|
+
s: 'scale',
|
|
57
|
+
scale: 'scale',
|
|
58
|
+
sx: 'scaleX',
|
|
59
|
+
scaleX: 'scaleX',
|
|
60
|
+
sy: 'scaleY',
|
|
61
|
+
scaleY: 'scaleY',
|
|
62
|
+
r: 'rotate',
|
|
63
|
+
rotate: 'rotate',
|
|
64
|
+
sk: 'skew',
|
|
65
|
+
skew: 'skew',
|
|
66
|
+
skx: 'skewX',
|
|
67
|
+
skewX: 'skewX',
|
|
68
|
+
sky: 'skewY',
|
|
69
|
+
skewY: 'skewY',
|
|
70
|
+
m3d: 'matrix3d',
|
|
71
|
+
matrix3d: 'matrix3d',
|
|
72
|
+
t3d: 'translate3d',
|
|
73
|
+
translate3d: 'translate3d',
|
|
74
|
+
tz: 'translateZ',
|
|
75
|
+
translateZ: 'translateZ',
|
|
76
|
+
s3d: 'scale3d',
|
|
77
|
+
scale3d: 'scale3d',
|
|
78
|
+
sz: 'scaleZ',
|
|
79
|
+
scaleZ: 'scaleZ',
|
|
80
|
+
r3d: 'rotate3d',
|
|
81
|
+
rotate3d: 'rotate3d',
|
|
82
|
+
rx: 'rotateX',
|
|
83
|
+
rotateX: 'rotateX',
|
|
84
|
+
ry: 'rotateY',
|
|
85
|
+
rotateY: 'rotateY',
|
|
86
|
+
rz: 'rotateZ',
|
|
87
|
+
rotateZ: 'rotateZ',
|
|
88
|
+
p: 'perspective',
|
|
89
|
+
perspective: 'perspective',
|
|
90
|
+
};
|
|
91
|
+
/* Function values */
|
|
92
|
+
const ref = `transform-matrix-1-2-3-4-5-6
|
|
93
|
+
transform-matrix3d-1-0-0-0-0-1-0-0-0-0-1-0-0-0-0-1
|
|
94
|
+
transform-perspective-17px
|
|
95
|
+
transform-rotate-0.5turn
|
|
96
|
+
transform-rotate3d-1-2-3-10deg
|
|
97
|
+
transform-rotateX-10deg
|
|
98
|
+
transform-rotateY-10deg
|
|
99
|
+
transform-rotateZ-10deg
|
|
100
|
+
transform-translate-12px-50%
|
|
101
|
+
transform-translate3d-12px-50%-3em
|
|
102
|
+
transform-translateX-2em
|
|
103
|
+
transform-translateY-3in
|
|
104
|
+
transform-translateZ-2px
|
|
105
|
+
transform-scale-2-0.5
|
|
106
|
+
transform-scale3d-2.5-1.2-0.3
|
|
107
|
+
transform-scaleX-2
|
|
108
|
+
transform-scaleY-0.5
|
|
109
|
+
transform-scaleZ-0.3
|
|
110
|
+
transform-skew-30deg-20deg
|
|
111
|
+
transform-skewX-30deg
|
|
112
|
+
transform-skewY-1.07rad
|
|
113
|
+
|
|
114
|
+
/* Multiple function values */
|
|
115
|
+
transform-translateX-10px--rotate-10deg--translateY-5px
|
|
116
|
+
transform-perspective-500px--translate-10px-0-20px--rotateY-3deg
|
|
117
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function transition(data: string): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default function transition(data) {
|
|
2
|
+
let holder = '';
|
|
3
|
+
data
|
|
4
|
+
.replace(/^-/, '')
|
|
5
|
+
.split(/__/)
|
|
6
|
+
.forEach((e) => {
|
|
7
|
+
const m = e.match(/^([a-z-]+)([0-9]+[d]?[0-9]*[m]?[s])([\w-_]*)/);
|
|
8
|
+
if (!m)
|
|
9
|
+
return;
|
|
10
|
+
const tf = m[3].replace(/^-/, '');
|
|
11
|
+
if (tf && func[tf]) {
|
|
12
|
+
holder += m[1].replace(/-$/, '') + ' ' + m[2].replace(/d/, '.') + ' ' + func[tf] + ',';
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
holder += m[1].replace(/-$/, '') + ' ' + m[2].replace(/d/, '.') + ',';
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return holder.replace(/[,]$/, '');
|
|
19
|
+
}
|
|
20
|
+
const func = {
|
|
21
|
+
e: 'ease',
|
|
22
|
+
ease: 'ease',
|
|
23
|
+
linear: 'linear',
|
|
24
|
+
l: 'linear',
|
|
25
|
+
ei: 'ease-in',
|
|
26
|
+
'ease-in': 'ease-in',
|
|
27
|
+
eo: 'ease-out',
|
|
28
|
+
'ease-out': 'ease-out',
|
|
29
|
+
eio: 'ease-in-out',
|
|
30
|
+
'ease-in-out': 'ease-in-out',
|
|
31
|
+
ss: 'step-start',
|
|
32
|
+
'step-start': 'step-start',
|
|
33
|
+
se: 'step-end',
|
|
34
|
+
'step-end': 'step-end',
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function url(data: string): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default function url(data) {
|
|
2
|
+
// bg-url3-path-to-folder-png
|
|
3
|
+
// bg-url3_path_to-the_folder_name_png
|
|
4
|
+
let holder = '';
|
|
5
|
+
data.split(/__/).forEach((each) => {
|
|
6
|
+
each = each.replace(/^[-]?url/, '');
|
|
7
|
+
if (each.match(/^--[a-zA-Z]/)) {
|
|
8
|
+
holder += `url(var(${each})),`;
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
let dir = '';
|
|
12
|
+
if (each.match(/^[-]?[\d][-_]/)) {
|
|
13
|
+
const ndir = /^([0-9])[-_]/.exec(each);
|
|
14
|
+
if (ndir)
|
|
15
|
+
for (let i = 0; i < parseInt(ndir[1], 10); i++) {
|
|
16
|
+
dir += '../';
|
|
17
|
+
}
|
|
18
|
+
each = each.replace(/^[\d]/, '');
|
|
19
|
+
}
|
|
20
|
+
if (!/^[-_]/.test(each)) {
|
|
21
|
+
each = '-' + each;
|
|
22
|
+
}
|
|
23
|
+
const divider = each.slice(0, 1);
|
|
24
|
+
each = each
|
|
25
|
+
.replace(/^[-_]/, '')
|
|
26
|
+
.replace(new RegExp(divider, 'g'), '/')
|
|
27
|
+
.replace(/[\/]([a-z0-9]+)$/, '.$1');
|
|
28
|
+
holder += "url('" + dir + each + "'),";
|
|
29
|
+
});
|
|
30
|
+
return holder.replace(/[,]$/, '').trim();
|
|
31
|
+
// note restriction not use folder with name that uses ../../also need to figure out for
|
|
32
|
+
// bg-url_3_path_to_folder-name_name_png--3_
|
|
33
|
+
}
|
package/lib/config.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const config: {
|
|
2
|
+
prefix: string | null;
|
|
3
|
+
matchExtractorFunction: RegExp | null;
|
|
4
|
+
matchRegExp: RegExp;
|
|
5
|
+
matchRegExpWithColon: RegExp;
|
|
6
|
+
matchRegExpKeyFrame: RegExp;
|
|
7
|
+
matchRegExpWithColonKeyFrame: RegExp;
|
|
8
|
+
useColon: boolean;
|
|
9
|
+
ignore: string[];
|
|
10
|
+
createExtractorRegex: (a: string) => RegExp;
|
|
11
|
+
createCSSModuleRegex: (a: string) => RegExp;
|
|
12
|
+
useExtractorFunction: boolean;
|
|
13
|
+
useCSSModule: boolean;
|
|
14
|
+
matchCSSModuleFunction: RegExp;
|
|
15
|
+
globalValues: string[];
|
|
16
|
+
styles: string[];
|
|
17
|
+
widths: string[];
|
|
18
|
+
modes: string[];
|
|
19
|
+
};
|
|
20
|
+
export default config;
|
package/lib/config.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
prefix: null,
|
|
3
|
+
useColon: false,
|
|
4
|
+
ignore: [],
|
|
5
|
+
useExtractorFunction: false,
|
|
6
|
+
matchExtractorFunction: new RegExp('(?:' + 'x|@' + ')' + "[\\s*]?(`|\\([" + `"'])` + "([^)`]+)" + "(`|" + `["']` + "\\))"),
|
|
7
|
+
useCSSModule: false,
|
|
8
|
+
matchCSSModuleFunction: new RegExp('(?:' + 'x|@' + ')' + "[\\s*]?(`|\\([" + `"'])` + "([^)`]+)" + "(`|" + `["']` + "\\))"),
|
|
9
|
+
matchRegExp: /(?:(class|className|class[-_][\w-\[\]=_]+))=[\s*]?(?:["']\W+\s*(?:\w+)\()?["']([^'"]+)['"]/,
|
|
10
|
+
matchRegExpWithColon: /(?:(class|className|class[-_:][\w-\[\]=_]+))=[\s*]?(?:["']\W+\s*(?:\w+)\()?["']([^'"]+)['"]/,
|
|
11
|
+
matchRegExpKeyFrame: /[\s](?:(keyframes[-_][\w-]+))=[\s*]?(?:["']\W+\s*(?:\w+)\()?["']([^'"]+)['"]/,
|
|
12
|
+
matchRegExpWithColonKeyFrame: /[\s](?:(keyframes[-_:][\w-]+))=[\s*]?(?:["']\W+\s*(?:\w+)\()?["']([^'"]+)['"]/,
|
|
13
|
+
createExtractorRegex: (fname) => new RegExp('(?:' + fname + ')' + "[\\s*]?(`|\\([" + `"'])` + "([^)`]+)" + "(`|" + `["']` + "\\))"),
|
|
14
|
+
createCSSModuleRegex: (fname) => new RegExp("(?:" + fname + ")\\[[`'" + '"]([^`"' + "']+)(?:[`'" + '"]\\])'),
|
|
15
|
+
globalValues: ['initial:ini', 'inherit:in', 'unset:un', 'revert:re', 'revert-layer:rl'],
|
|
16
|
+
styles: ['dotted:d', 'dashed:da', 'solid:s', 'double:db', 'groove:g', 'ridge:ri', 'inset:i', 'outset:o', 'none:n', 'hidden:h'],
|
|
17
|
+
widths: ['medium:m', 'thin:t', 'thick:th:t2'],
|
|
18
|
+
modes: ['normal:nl', 'multiply:m', 'screen:s', 'overlay:o', 'darken:d', 'lighten:l', 'color-dodge:cd', 'color-burn:cb', 'hard-light:hl',
|
|
19
|
+
'soft-light:sl', 'difference:di:d2', 'exclusion:e', 'hue:h', 'saturation:sa:s2', 'color:c', 'luminosity:lu:l2'],
|
|
20
|
+
};
|
|
21
|
+
export default config;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Property = {
|
|
2
|
+
alias?: string;
|
|
3
|
+
property?: string;
|
|
4
|
+
test?: RegExp;
|
|
5
|
+
type?: string;
|
|
6
|
+
values?: string[];
|
|
7
|
+
compiler?: (a: string, b: {
|
|
8
|
+
[key: string]: {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
}) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const cssProps: {
|
|
14
|
+
[key: string]: Property;
|
|
15
|
+
};
|
|
16
|
+
export default cssProps;
|