amis/scss/components/_tabs.scss

266 lines
5.8 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}Tabs {
2019-12-06 09:58:08 +08:00
&-links {
border-bottom: $Tabs-borderWidth solid $Tabs-borderColor;
padding-left: 0;
margin-bottom: 0;
list-style: none;
&::before {
display: table;
content: ' ';
}
2019-12-06 09:58:08 +08:00
> .#{$ns}Tabs-link {
margin-bottom: -$Tabs-borderWidth;
display: inline-block;
position: relative;
> a:first-child {
font-size: $Tabs-linkFontSize;
outline: none;
border: $Tabs-borderWidth solid transparent;
border-top-left-radius: $Tabs-borderRadius;
border-top-right-radius: $Tabs-borderRadius;
color: $Tabs-color;
margin: $Tabs-linkMargin;
padding: $Tabs-linkPadding;
text-decoration: none;
cursor: pointer;
display: block;
}
> .#{$ns}Combo-toolbarBtn {
position: absolute;
right: -10px;
top: -10px;
z-index: 10;
display: none;
}
&:hover > .#{$ns}Combo-toolbarBtn {
display: block;
}
&:hover > a:first-child,
> a:first-child:focus {
border-color: $Tabs-onHover-borderColor;
text-decoration: none;
}
&.disabled > a:first-child,
&.is-disabled > a:first-child {
color: $Tabs-onDisabled-color;
background-color: transparent;
border-color: transparent;
pointer-events: none;
}
&.active > a:first-child,
&.is-active > a:first-child {
color: $Tabs-onActive-color;
background-color: $Tabs-onActive-bg;
border-color: $Tabs-onActive-borderColor;
border-bottom-color: transparent;
}
}
}
&-content {
background-color: $Tabs-content-bg;
padding: $gap-base;
border-style: solid;
border-width: 0 $Tabs-borderWidth $Tabs-borderWidth;
border-color: $Tabs-borderColor;
}
&-pane {
display: none;
opacity: 0;
transition: opacity 0.35s linear;
&.is-active {
display: block;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&.in {
opacity: 1;
2019-08-13 11:12:42 +08:00
}
2019-12-06 09:58:08 +08:00
}
&--line {
> .#{$ns}Tabs-links {
border-bottom-color: $Tabs--line-borderColor;
> li {
> a:first-child {
border-width: 0 0 $Tabs--line-borderWidth 0;
padding: $Tabs--line-linkPadding;
margin: $Tabs--line-linkMargin;
&:hover,
&:focus {
color: #666;
background-color: transparent;
border-color: transparent;
}
}
2019-08-07 15:36:05 +08:00
2019-12-06 09:58:08 +08:00
&:last-child {
> a {
margin: 0;
}
}
2019-09-09 00:53:39 +08:00
2019-08-13 11:12:42 +08:00
&.is-active {
2019-12-06 09:58:08 +08:00
> a:first-child,
> a:first-child:hover,
> a:first-child:focus {
border-color: $Tabs--line-onHover-borderColor;
color: $Tabs--line-onHover-color;
background-color: transparent;
}
2019-08-07 15:36:05 +08:00
}
2019-12-06 09:58:08 +08:00
}
}
2019-09-09 00:53:39 +08:00
2019-12-06 09:58:08 +08:00
> .#{$ns}Tabs-content {
border-width: 0;
padding: $Tabs--line-content-padding;
background-color: $Tabs--line-content-bg;
}
2019-12-06 09:58:08 +08:00
}
2019-12-06 09:58:08 +08:00
&--card {
> .#{$ns}Tabs-links {
padding: $Tabs--card-padding;
background-color: $Tabs--card-bg;
border-top: px2rem(1px) solid $Tabs--card-borderTopColor;
2019-09-25 17:06:08 +08:00
2019-12-06 09:58:08 +08:00
> li {
&.is-active {
> a:first-child,
> a:first-child:hover,
> a:first-child:focus {
border-color: $Tabs--card-onActive-borderColor;
color: $primary;
border-bottom-color: $Tabs--card-onActive-bg;
background-color: $Tabs--card-onActive-bg;
}
2019-09-25 17:06:08 +08:00
}
2019-12-06 09:58:08 +08:00
> a:first-child {
padding: $Tabs--card-linkPadding;
margin: $Tabs--card-linkMargin;
2019-09-25 17:06:08 +08:00
2019-12-06 09:58:08 +08:00
&:hover,
&:focus {
color: #666;
background-color: $Tabs--card-onActive-bg;
border-bottom-color: transparent;
}
2019-09-25 17:06:08 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
> .#{$ns}Tabs-content {
border-width: 0;
}
}
&--radio {
> .#{$ns}Tabs-links {
border: 0;
margin-bottom: px2rem(10px);
> li {
margin: 0;
> a:first-child {
border-width: px2rem(1px);
border-color: $Tabs-borderColor;
font-size: $fontSizeSm;
text-align: center;
margin: 0;
padding: 0 px2rem(10px);
min-width: 68px;
height: px2rem(30px);
line-height: px2rem(30px);
border-radius: 0;
background: $Tabs--radio-bg;
&:hover,
&:focus {
color: $primary;
}
2019-10-29 12:37:20 +08:00
}
2019-12-06 09:58:08 +08:00
&.is-active {
> a:first-child,
> a:first-child:hover,
> a:first-child:focus {
color: $Tabs--radio-bg;
background-color: $primary;
border-color: $primary;
position: relative;
z-index: 1;
}
2019-10-29 12:37:20 +08:00
}
2019-12-06 09:58:08 +08:00
}
> li + li {
margin-left: -1px;
}
2019-10-29 12:37:20 +08:00
}
2019-12-06 09:58:08 +08:00
> .#{$ns}Tabs-content {
border-top: $Tabs-borderWidth solid $Tabs-borderColor;
}
}
&--vertical {
display: flex;
min-height: px2rem(200px);
border: $Tabs-borderWidth solid $Tabs-borderColor;
border-radius: 0;
> .#{$ns}Tabs-links {
width: px2rem(140px);
background: #f5f5f5;
border: none;
padding-bottom: px2rem(60px);
> li {
margin: 0 0 0 -1px;
display: block;
> a:first-child {
border-color: transparent;
border-radius: 0;
border-width: 0 0 0 px2rem(4px);
margin: 0;
&:hover,
&:focus {
color: $primary;
border-color: transparent;
}
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&.is-active {
> a:first-child,
> a:first-child:hover,
> a:first-child:focus {
color: $primary;
border-color: $primary;
}
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
}
> .#{$ns}Tabs-content {
border: none;
flex-grow: 1;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
}