Skip to content

Commit 4925fb5

Browse files
committed
feat: info custom container
1 parent de26289 commit 4925fb5

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

docs/guide/markdown.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ Custom containers can be defined by their types, titles, and contents.
128128
This is a tip
129129
:::
130130

131+
::: info
132+
This is an info box
133+
:::
134+
131135
::: warning
132136
This is a warning
133137
:::
@@ -143,6 +147,10 @@ This is a dangerous warning
143147
This is a tip
144148
:::
145149

150+
::: info
151+
This is an info box
152+
:::
153+
146154
::: warning
147155
This is a warning
148156
:::

src/client/theme-default/styles/custom-blocks.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.custom-block.tip,
2+
.custom-block.info,
23
.custom-block.warning,
34
.custom-block.danger {
45
margin: 1rem 0;
@@ -12,6 +13,11 @@
1213
border-color: var(--c-brand);
1314
}
1415

16+
.custom-block.info {
17+
background-color: #f3f5f7;
18+
border-color: var(--c-text-light-2);
19+
}
20+
1521
.custom-block.warning {
1622
border-color: #e7c000;
1723
color: #6b5900;

src/node/markdown/plugins/containers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const container = require('markdown-it-container')
55

66
export const containerPlugin = (md: MarkdownIt) => {
77
md.use(...createContainer('tip', 'TIP'))
8+
.use(...createContainer('info', 'INFO'))
89
.use(...createContainer('warning', 'WARNING'))
910
.use(...createContainer('danger', 'WARNING'))
1011
// explicitly escape Vue syntax

0 commit comments

Comments
 (0)