new: add details custom block from @vue\theme-default since v1.3.0

This commit is contained in:
yxxy 2020-06-16 19:48:30 +08:00
parent 8ffb1edc96
commit 08344fe8b5
2 changed files with 22 additions and 1 deletions

View File

@ -98,7 +98,11 @@ module.exports = (options, ctx) => {
'/zh/': '警告'
}
}],
['container', {
type: 'details',
before: info => `<details class="custom-block details">${info ? `<summary>${info}</summary>` : ''}\n`,
after: () => '</details>\n'
}],
// 卡片列表
[
'container',

View File

@ -29,6 +29,22 @@
color darken(red, 40%)
a
color var(--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
//
.theme-mode-dark
@ -39,6 +55,7 @@
.custom-block-title
color darken(#ffe564, 15%)
&.tip
&.details
background-color rgba(243, 245, 247, .2)
color darken(#42b983, 0%)
&.danger