Skip to content

Commit 3c430f8

Browse files
committed
feat($markdown): support 'vue' container
1 parent 5de419e commit 3c430f8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/@vuepress/markdown/lib/containers.js

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ module.exports = md => {
1111
? `<div v-pre>\n`
1212
: `</div>\n`
1313
})
14+
.use(container, 'vue', {
15+
render: (tokens, idx) => tokens[idx].nesting === 1
16+
? `<pre class="vue-container"><code>`
17+
: `</code></pre>`
18+
})
1419
}
1520

1621
function createContainer (klass, defaultTitle) {

packages/@vuepress/theme-default/styles/custom-blocks.styl

+12
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,15 @@
2626
color darken(red, 40%)
2727
a
2828
color $textColor
29+
30+
pre.vue-container
31+
background-color: #f3f5f7 !important;
32+
color: #2c3e50 !important;
33+
border-left-width: .5rem;
34+
border-left-style: solid;
35+
border-color: #42b983;
36+
code
37+
color: #2c3e50 !important;
38+
font-size: 14px !important;
39+
& > p
40+
margin: -20px 0;

0 commit comments

Comments
 (0)