diff --git a/packages/@vuepress/theme-default/index.js b/packages/@vuepress/theme-default/index.js index 3e71be184b..baaf102ba7 100644 --- a/packages/@vuepress/theme-default/index.js +++ b/packages/@vuepress/theme-default/index.js @@ -48,6 +48,11 @@ module.exports = (options, ctx) => { '/zh/': '警告' } }], + ['container', { + type: 'details', + before: info => `
${info ? `${info}` : ''}\n`, + after: () => '
\n' + }], ['smooth-scroll', enableSmoothScroll] ] } diff --git a/packages/@vuepress/theme-default/styles/custom-blocks.styl b/packages/@vuepress/theme-default/styles/custom-blocks.styl index 2d07835b88..5b868166a4 100644 --- a/packages/@vuepress/theme-default/styles/custom-blocks.styl +++ b/packages/@vuepress/theme-default/styles/custom-blocks.styl @@ -26,5 +26,19 @@ color darken(red, 40%) a color $textColor - - + &.details + display block + position relative + border-radius 2px + margin 1.6em 0 + padding 1.6em + background-color #eee + h4 + margin-top 0 + figure, p + &:last-child + margin-bottom 0 + padding-bottom 0 + summary + outline none + cursor pointer