@@ -36,15 +36,16 @@ To ensure the code block styles automatically adjust to your theme mode (light o
36
36
``` css
37
37
/* file: style.css */
38
38
@media (prefers-color-scheme: dark) {
39
- .shiki ,
40
- .shiki span {
41
- color : var (--shiki-dark ) !important ;
42
- background-color : var (--shiki-dark-bg ) !important ;
43
- /* Optional, if you also want font styles */
44
- font-style : var (--shiki-dark-font-style ) !important ;
45
- font-weight : var (--shiki-dark-font-weight ) !important ;
46
- text-decoration : var (--shiki-dark-text-decoration ) !important ;
47
- }
39
+ .shiki ,
40
+ .shiki span {
41
+ color : var (--shiki-dark ) !important ;
42
+ background-color : var (--shiki-dark-bg ) !important ;
43
+ /* Optional, if you also want font styles */
44
+ font-style : var (--shiki-dark-font-style ) !important ;
45
+ font-weight : var (--shiki-dark-font-weight ) !important ;
46
+ text-decoration : var (--shiki-dark-text-decoration ) !important ;
47
+ }
48
+ }
48
49
```
49
50
50
51
Class-based Dark Mode
@@ -78,13 +79,14 @@ import "./style.css";
78
79
79
80
## API
80
81
81
- | Property | Description | Type | Default |
82
- | --------------- | -------------------------------------------------------- | --------- | -------------------------------------------- |
83
- | block | Receives render code content from ` NotionRenderer ` | CodeBlock | - |
84
- | className | Additional class for Code | string | - |
85
- | defaultLanguage | Default programming language if not specified in ` block ` | string | typescript |
86
- | themes | Themes for rendering code | object | {light: "catppuccin-latte", dark: "dracula"} |
87
- | showCopy | Whether to show the copy button | boolean | true |
82
+ | Property | Description | Type | Default |
83
+ | --------------- | -------------------------------------------------------------------------- | --------- | -------------------------------------------- |
84
+ | block | Receives render code content from ` NotionRenderer ` | CodeBlock | - |
85
+ | className | Additional class for Code | string | - |
86
+ | defaultLanguage | Default programming language if not specified in ` block ` | string | typescript |
87
+ | themes | Themes for rendering code | object | {light: "catppuccin-latte", dark: "dracula"} |
88
+ | showCopy | Whether to show the copy button | boolean | true |
89
+ | lazyLoading | Whether to run highlighting rendering when a code block is within viewport | boolean | true |
88
90
89
91
## Run the Example
90
92
0 commit comments