You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All properies below are available for chaining. But, only those marked with an asterisk `*` are supported by the config. These also accept css values, while the properties without an `*` don't take any arguments i.e. `blue()` and `bold()`.
61
+
62
+
*`blue`, `red`, `turquoise`, `aquamarine`, etc for [all web colors](https://en.wikipedia.org/wiki/Web_colors#X11_color_names) lowercased
*`bgblue`, `bgred`, `bgturquoise`, `bgaquamarine` etc for [all web colors](https://en.wikipedia.org/wiki/Web_colors#X11_color_names) lowercased and prefixed with `bg`
77
+
* bg*
78
+
* shadow*
79
+
* padding*
80
+
* margin*
81
+
* css*
54
82
55
-
Everything to the right of the colon are used for shorthand chaining i.e. `.bold()` and `.cursive()`. Everything to the left are used as keys in chaining and configs i.e. `.weight('bold')` or `{weight: 'bold'}`. All keys support css values.
83
+
### Examples
56
84
57
-
1. color: [all web colors](https://en.wikipedia.org/wiki/Web_colors#X11_color_names) lowercased
pwc({ shadow:'4px 4px 5px green' }).large().error('large error msg with green shadow')
73
91
74
-
```javascript
75
-
/* 1. config */
76
-
pwc({ bg:'red' })
77
-
pwc({ bg:'#f00' })
78
-
pwc({ bg:'rgb(255,0,0)' })
79
-
80
-
/* 2. chaining */
81
-
pwc().bg('red')
82
-
pwc().bg('#f00')
83
-
pwc().bg('rgb(255,0,0)')
84
-
pwc().bgred()
92
+
pwc({ weight:'bold', color:'#00f' }).size(20).log('bold, blue, and 20px msg')
85
93
```
86
94
87
-
As shown above, any css value can be used, unless you are using the shorthand chaining api i.e. `.bgred()` which doesn't take any arguments.
95
+
Have fun with making your logs pretty!
88
96
89
97
## Log Levels
90
98
91
-
`.log()`, `.warn()`, `.error()`, `.info()`, and `.debug()` are supported.
99
+
*`.log()`
100
+
*`.warn()`
101
+
*`.error()`
102
+
*`.info()`
103
+
*`.debug()`
92
104
93
105
## Custom Logger
94
106
95
-
By default, the logger used is the standard browser console. But, you may pass in your own logger if you want!
107
+
By default, the logger used is the standard browser console. But, you may pass in your own logger if you want.
96
108
97
-
For example, `pwc().blue().bold().underline().warn('hi', customWarnFn)` would pass the message and a css styles object as arguments to `customWarnFn`. The styles object for the example would look like this:
109
+
For example, let's say you have a logger function named `customWarnFn`. You just need to pass it to the log function as the second argument i.e. `pwc().blue().bold().underline().warn('hi', customWarnFn)`. This passes the message and a css styles object as arguments to your custom logger. The styles object for the example would look like this:
98
110
99
111
```javascript
100
112
{
@@ -104,6 +116,8 @@ For example, `pwc().blue().bold().underline().warn('hi', customWarnFn)` would pa
0 commit comments