tabs
This commit is contained in:
parent
a54ff9cfba
commit
6a8e773a42
|
@ -30,7 +30,7 @@ module.exports = ctx => function(args, content) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tabNav = `<ul class="nav-tabs">${tabNav}</ul>`;
|
tabNav = `<ul class="nav-tabs">${tabNav}</ul>`;
|
||||||
tabContent = `<div class="tab-content fs14">${tabContent}</div>`;
|
tabContent = `<div class="tab-content">${tabContent}</div>`;
|
||||||
|
|
||||||
return `<div class="tag-plugin tabs" id="${tabName.toLowerCase().split(' ').join('-')}">${tabNav + tabContent}</div>`;
|
return `<div class="tag-plugin tabs" id="${tabName.toLowerCase().split(' ').join('-')}">${tabNav + tabContent}</div>`;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,76 +1,70 @@
|
||||||
$tbr = $border-block
|
$tbr = $border-block
|
||||||
|
|
||||||
.tag-plugin.tabs
|
.tag-plugin.tabs
|
||||||
display: block
|
|
||||||
position: relative
|
position: relative
|
||||||
margin-top: 1rem
|
margin-top: 1rem
|
||||||
margin-bottom: 1rem
|
margin-bottom: 1rem
|
||||||
border-radius: $tbr
|
display: flex
|
||||||
border: 1px solid var(--block-border)
|
flex-direction: column
|
||||||
font-size: $fs-14
|
|
||||||
|
|
||||||
.tag-plugin.tabs
|
.tag-plugin.tabs
|
||||||
ul.nav-tabs
|
ul.nav-tabs
|
||||||
display: flex
|
display: flex
|
||||||
overflow-x: auto
|
align-self: center
|
||||||
|
overflow: scroll visible
|
||||||
|
scrollbar(0, 0)
|
||||||
|
max-width: 100%
|
||||||
white-space: nowrap
|
white-space: nowrap
|
||||||
justify-content: flex-start
|
|
||||||
margin: 0 !important
|
margin: 0 !important
|
||||||
padding: 8px 8px 0 8px
|
|
||||||
background: var(--block)
|
|
||||||
border-radius: $tbr $tbr 0 0
|
|
||||||
line-height: 1.5
|
line-height: 1.5
|
||||||
|
position: relative
|
||||||
|
padding: 8px 0
|
||||||
|
&:after
|
||||||
|
content: ''
|
||||||
|
position: absolute
|
||||||
|
background: var(--block-hover)
|
||||||
|
width: 100%
|
||||||
|
height: 2px
|
||||||
|
bottom: 0
|
||||||
|
left: 0
|
||||||
|
border-radius: 2px
|
||||||
li.tab
|
li.tab
|
||||||
list-style-type: none
|
list-style-type: none
|
||||||
margin-top: 0
|
|
||||||
margin-bottom: 0
|
|
||||||
&:last-child
|
|
||||||
padding-right: 1rem
|
|
||||||
a
|
a
|
||||||
display: block
|
display: block
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
border-radius: $tbr $tbr 0 0
|
padding: .25rem .75rem
|
||||||
padding: 0.5rem
|
font-size: $fs-13
|
||||||
text-align: center
|
|
||||||
font-size: $fs-14
|
|
||||||
line-height: inherit
|
line-height: inherit
|
||||||
font-weight: 700
|
font-weight: 700
|
||||||
color: var(--text-p3)
|
color: var(--text-p3)
|
||||||
border: 1px solid transparent
|
border-radius: 4px
|
||||||
|
position: relative
|
||||||
|
margin: 0 2px
|
||||||
&:hover
|
&:hover
|
||||||
color: var(--text-p1)
|
color: var(--text-p1)
|
||||||
|
background: var(--block-hover)
|
||||||
i
|
i
|
||||||
pointer-events: none
|
pointer-events: none
|
||||||
&.active a
|
&.active a
|
||||||
cursor: default
|
cursor: default
|
||||||
color: var(--text-p1)
|
color: var(--text-p1)
|
||||||
background: var(--card)
|
background: var(--card)
|
||||||
border: 1px solid var(--block-border)
|
box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.04), 0 0 8px 0px rgba(0, 0, 0, 0.04)
|
||||||
border-bottom: 1px solid var(--card)
|
&:after
|
||||||
|
content: ''
|
||||||
|
z-index: 1
|
||||||
|
position: absolute
|
||||||
|
background: $color-theme
|
||||||
|
width: 'calc(100% - 2 * %s)' % .5rem
|
||||||
|
height: 2px
|
||||||
|
bottom: -8px
|
||||||
|
left: .5rem
|
||||||
|
border-radius: 2px
|
||||||
|
|
||||||
.tab-content
|
.tab-content
|
||||||
border-top: 1px solid var(--block-border)
|
|
||||||
margin-top: -1px
|
|
||||||
background: var(--card)
|
|
||||||
border-radius: 0 0 $tbr $tbr
|
|
||||||
.tab-pane
|
.tab-pane
|
||||||
padding: 1rem
|
|
||||||
&:not(.active)
|
&:not(.active)
|
||||||
display: none
|
display: none
|
||||||
&.active
|
&.active
|
||||||
display: block
|
display: block
|
||||||
>:first-child, li:first-child>p
|
|
||||||
margin-top: 0
|
|
||||||
>:last-child
|
|
||||||
margin-bottom: 0
|
|
||||||
|
|
||||||
|
|
||||||
.tag-plugin.tabs .tab-pane[codeblock]
|
|
||||||
padding: 0
|
|
||||||
.highlight
|
|
||||||
border: none
|
|
||||||
border-radius: 0
|
|
||||||
background: transparent
|
|
||||||
margin: 0
|
|
||||||
.code:before
|
|
||||||
content: none
|
|
||||||
|
|
Loading…
Reference in New Issue