@@ -3,44 +3,47 @@ import chalkString from 'chalk-string';
3
3
const newStyle = chalkString ( ) ;
4
4
5
5
// @ts -ignore
6
- const style = ( styleString = '' , value = '' ) => newStyle ( styleString , value ) ;
6
+ const style = ( styleString = "" , value = "" ) =>
7
+ styleString ? newStyle ( styleString , value ) : value ;
7
8
8
9
export const getTheme = ( customTheme ) => ( {
9
- h1 : ( value ) => style ( customTheme . h1 || ' red bold' , value ) ,
10
- h2 : ( value ) => style ( customTheme . h2 || ' blue bold' , value ) ,
11
- h3 : ( value ) => style ( customTheme . h3 || ' blue bold' , value ) ,
12
- h4 : ( value ) => style ( customTheme . h4 || ' cyan bold' , value ) ,
13
- h5 : ( value ) => style ( customTheme . h5 || ' cyan' , value ) ,
14
- h6 : ( value ) => style ( customTheme . h6 || ' cyan' , value ) ,
10
+ h1 : ( value ) => style ( customTheme . h1 || " red bold" , value ) ,
11
+ h2 : ( value ) => style ( customTheme . h2 || " blue bold" , value ) ,
12
+ h3 : ( value ) => style ( customTheme . h3 || " blue bold" , value ) ,
13
+ h4 : ( value ) => style ( customTheme . h4 || " cyan bold" , value ) ,
14
+ h5 : ( value ) => style ( customTheme . h5 || " cyan" , value ) ,
15
+ h6 : ( value ) => style ( customTheme . h6 || " cyan" , value ) ,
15
16
16
17
//
17
- a : ( value ) => style ( customTheme . a || ' blue underline' , value ) ,
18
- figcaption : ( value ) => style ( customTheme . figcaption || ' bgGreen bold' , value ) ,
19
- blockquote : ( value ) => style ( customTheme . blockquote || ' black' , value ) ,
18
+ a : ( value ) => style ( customTheme . a || " blue underline" , value ) ,
19
+ figcaption : ( value ) => style ( customTheme . figcaption || " bgGreen bold" , value ) ,
20
+ blockquote : ( value ) => style ( customTheme . blockquote || " black" , value ) ,
20
21
21
22
// CODE
22
- code : ( value ) => style ( customTheme . inlineCode || 'yellowBright' , value ) ,
23
- inlineCode : ( value ) => style ( customTheme . inlineCode || 'bgBlack' , value ) ,
24
- codeNumbers : ( value ) => style ( customTheme . codeNumbers || 'blackBright dim' , value ) ,
25
-
26
- dt : ( value ) => style ( customTheme . dt || 'blue bold' , value ) ,
27
- dd : ( value ) => style ( customTheme . dt || 'cyan' , value ) ,
28
- dl : ( value ) => style ( customTheme . dl || '' , value ) ,
29
-
30
- del : ( value ) => style ( customTheme . del || 'bgRed black' , value ) ,
31
- ins : ( value ) => style ( customTheme . ins || 'bgGreen black' , value ) ,
32
- strike : ( value ) => style ( customTheme . strikethrough || 'strikethrough' , value ) ,
33
- underline : ( value ) => style ( customTheme . underline || 'underline' , value ) ,
34
- bold : ( value ) => style ( customTheme . bold || 'bold' , value ) ,
35
- samp : ( value ) => style ( customTheme . samp || 'yellowBright' , value ) ,
36
- kbd : ( value ) => style ( customTheme . kbd || 'bgBlack' , value ) ,
37
- var : ( value ) => style ( customTheme . variableTag || 'blue italic' , value ) ,
38
- mark : ( value ) => style ( customTheme . mark || 'bgYellow black' , value ) ,
39
- time : ( value ) => style ( customTheme . mark || 'cyan' , value ) ,
23
+ code : ( value ) => style ( customTheme . inlineCode || "yellowBright" , value ) ,
24
+ inlineCode : ( value ) => style ( customTheme . inlineCode || "bgBlack" , value ) ,
25
+ codeNumbers : ( value ) =>
26
+ style ( customTheme . codeNumbers || "blackBright dim" , value ) ,
27
+
28
+ dt : ( value ) => style ( customTheme . dt || "blue bold" , value ) ,
29
+ dd : ( value ) => style ( customTheme . dt || "cyan" , value ) ,
30
+ dl : ( value ) => style ( customTheme . dl || "" , value ) ,
31
+
32
+ del : ( value ) => style ( customTheme . del || "bgRed black" , value ) ,
33
+ ins : ( value ) => style ( customTheme . ins || "bgGreen black" , value ) ,
34
+ strike : ( value ) => style ( customTheme . strikethrough || "strikethrough" , value ) ,
35
+ underline : ( value ) => style ( customTheme . underline || "underline" , value ) ,
36
+ bold : ( value ) => style ( customTheme . bold || "bold" , value ) ,
37
+ samp : ( value ) => style ( customTheme . samp || "yellowBright" , value ) ,
38
+ kbd : ( value ) => style ( customTheme . kbd || "bgBlack" , value ) ,
39
+ var : ( value ) => style ( customTheme . variableTag || "blue italic" , value ) ,
40
+ mark : ( value ) => style ( customTheme . mark || "bgYellow black" , value ) ,
41
+ time : ( value ) => style ( customTheme . mark || "cyan" , value ) ,
40
42
41
43
//
42
- italic : ( value ) => style ( customTheme . italic || 'italic' , value ) ,
43
- i : ( value ) => style ( customTheme . i || customTheme . italic || 'italic' , value ) ,
44
- em : ( value ) => style ( customTheme . em || customTheme . italic || 'italic' , value ) ,
45
- cite : ( value ) => style ( customTheme . cite || customTheme . italic || 'italic' , value ) ,
44
+ italic : ( value ) => style ( customTheme . italic || "italic" , value ) ,
45
+ i : ( value ) => style ( customTheme . i || customTheme . italic || "italic" , value ) ,
46
+ em : ( value ) => style ( customTheme . em || customTheme . italic || "italic" , value ) ,
47
+ cite : ( value ) =>
48
+ style ( customTheme . cite || customTheme . italic || "italic" , value ) ,
46
49
} ) ;
0 commit comments