bulma/sass/components/tabs.sass

202 lines
8.2 KiB
Sass
Raw Normal View History

2020-08-22 09:54:08 +00:00
$tabs-font-size: var(--size-normal, #{$size-normal}) !default
$tabs-border-bottom-color: var(--border, #{$border}) !default
2017-07-28 20:05:15 +00:00
$tabs-border-bottom-style: solid !default
$tabs-border-bottom-width: 1px !default
2020-08-22 09:54:08 +00:00
$tabs-link-color: var(--text, #{$text}) !default
$tabs-link-hover-border-bottom-color: var(--text-strong, #{$text-strong}) !default
$tabs-link-hover-color: var(--text-strong, #{$text-strong}) !default
$tabs-link-active-border-bottom-color: var(--link, #{$link}) !default
$tabs-link-active-color: var(--link, #{$link}) !default
2017-07-28 20:05:15 +00:00
$tabs-link-padding: 0.5em 1em !default
2020-08-22 09:54:08 +00:00
$tabs-boxed-link-radius: var(--radius, #{$radius}) !default
$tabs-boxed-link-hover-background-color: var(--background, #{$background}) !default
$tabs-boxed-link-hover-border-bottom-color: var(--border, #{$border}) !default
2017-07-28 20:05:15 +00:00
2020-08-22 09:54:08 +00:00
$tabs-boxed-link-active-background-color: var(--scheme-main, #{$scheme-main}) !default
$tabs-boxed-link-active-border-color: var(--border, #{$border}) !default
2017-07-30 18:25:24 +00:00
$tabs-boxed-link-active-border-bottom-color: transparent !default
2017-07-28 20:05:15 +00:00
2020-08-22 09:54:08 +00:00
$tabs-toggle-link-border-color: var(--border, #{$border}) !default
2017-07-28 20:05:15 +00:00
$tabs-toggle-link-border-style: solid !default
$tabs-toggle-link-border-width: 1px !default
2020-08-22 09:54:08 +00:00
$tabs-toggle-link-hover-background-color: var(--background, #{$background}) !default
$tabs-toggle-link-hover-border-color: var(--border-hover, #{$border-hover}) !default
$tabs-toggle-link-radius: var(--radius, #{$radius}) !default
$tabs-toggle-link-active-background-color: var(--link, #{$link}) !default
$tabs-toggle-link-active-border-color: var(--link, #{$link}) !default
$tabs-toggle-link-active-color: var(--link-invert, #{$link-invert}) !default
2017-07-28 20:05:15 +00:00
2016-01-24 00:03:43 +00:00
.tabs
2020-08-22 09:54:08 +00:00
--tabs-font-size: #{$tabs-font-size}
--tabs-border-bottom-color: #{$tabs-border-bottom-color}
--tabs-border-bottom-style: #{$tabs-border-bottom-style}
--tabs-border-bottom-width: #{$tabs-border-bottom-width}
--tabs-link-color: #{$tabs-link-color}
--tabs-link-padding: #{$tabs-link-padding}
--tabs-link-hover-border-bottom-color: #{$tabs-link-hover-border-bottom-color}
--tabs-link-hover-color: #{$tabs-link-hover-color}
--tabs-link-active-border-bottom-color: #{$tabs-link-active-border-bottom-color}
--tabs-link-active-color: #{$tabs-link-active-color}
--tabs-boxed-link-radius: #{$tabs-boxed-link-radius}
--tabs-boxed-link-hover-background-color: #{$tabs-boxed-link-hover-background-color}
--tabs-boxed-link-hover-border-bottom-color: #{$tabs-boxed-link-hover-border-bottom-color}
--tabs-boxed-link-active-background-color: #{$tabs-boxed-link-active-background-color}
--tabs-boxed-link-active-border-color: #{$tabs-boxed-link-active-border-color}
--tabs-boxed-link-active-border-bottom-color: #{$tabs-boxed-link-active-border-bottom-color}
--tabs-toggle-link-border-color: #{$tabs-toggle-link-border-color}
--tabs-toggle-link-border-style: #{$tabs-toggle-link-border-style}
--tabs-toggle-link-border-width: #{$tabs-toggle-link-border-width}
--tabs-toggle-link-hover-background-color: #{$tabs-toggle-link-hover-background-color}
--tabs-toggle-link-hover-border-color: #{$tabs-toggle-link-hover-border-color}
--tabs-toggle-link-radius: #{$tabs-toggle-link-radius}
--tabs-toggle-link-active-background-color: #{$tabs-toggle-link-active-background-color}
--tabs-toggle-link-active-border-color: #{$tabs-toggle-link-active-border-color}
--tabs-toggle-link-active-color: #{$tabs-toggle-link-active-color}
2018-09-04 13:24:50 +00:00
@extend %block
2017-04-15 16:54:47 +00:00
+overflow-touch
2018-09-04 13:24:50 +00:00
@extend %unselectable
2016-05-07 22:40:06 +00:00
align-items: stretch
display: flex
2020-08-22 09:54:08 +00:00
font-size: var(--tabs-font-size)
2016-05-07 22:40:06 +00:00
justify-content: space-between
2016-01-24 00:03:43 +00:00
overflow: hidden
overflow-x: auto
white-space: nowrap
a
2016-05-05 21:23:08 +00:00
align-items: center
2020-08-22 09:54:08 +00:00
border-bottom-color: var(--tabs-border-bottom-color)
border-bottom-style: var(--tabs-border-bottom-style)
border-bottom-width: var(--tabs-border-bottom-width)
color: var(--tabs-link-color)
2016-05-05 21:23:08 +00:00
display: flex
justify-content: center
2020-08-22 09:54:08 +00:00
margin-bottom: calc(-1 * #{var(--tabs-border-bottom-width)})
padding: var(--tabs-link-padding)
2016-01-24 00:03:43 +00:00
vertical-align: top
&:hover
2020-08-22 09:54:08 +00:00
border-bottom-color: var(--tabs-link-hover-border-bottom-color)
color: var(--tabs-link-hover-color)
2016-01-24 00:03:43 +00:00
li
display: block
2016-01-24 00:03:43 +00:00
&.is-active
a
2020-08-22 09:54:08 +00:00
border-bottom-color: var(--tabs-link-active-border-bottom-color)
color: var(--tabs-link-active-color)
2016-01-24 00:03:43 +00:00
ul
2016-05-07 22:40:06 +00:00
align-items: center
2020-08-22 09:54:08 +00:00
border-bottom-color: var(--tabs-border-bottom-color)
border-bottom-style: var(--tabs-border-bottom-style)
border-bottom-width: var(--tabs-border-bottom-width)
display: flex
2016-07-31 10:45:56 +00:00
flex-grow: 1
flex-shrink: 0
2016-05-07 22:40:06 +00:00
justify-content: flex-start
&.is-left
2016-10-30 22:52:04 +00:00
padding-right: 0.75em
2016-05-07 22:40:06 +00:00
&.is-center
flex: none
justify-content: center
2016-10-30 22:52:04 +00:00
padding-left: 0.75em
padding-right: 0.75em
2016-05-07 22:40:06 +00:00
&.is-right
justify-content: flex-end
2016-10-30 22:52:04 +00:00
padding-left: 0.75em
2016-05-05 21:23:08 +00:00
.icon
&:first-child
2020-01-22 09:14:04 +00:00
+ltr-property("margin", 0.5em)
2016-05-05 21:23:08 +00:00
&:last-child
2020-01-22 09:14:04 +00:00
+ltr-property("margin", 0.5em, false)
2016-05-07 22:40:06 +00:00
// Alignment
&.is-centered
ul
justify-content: center
&.is-right
ul
justify-content: flex-end
// Styles
2016-01-24 00:03:43 +00:00
&.is-boxed
a
border: 1px solid transparent
2020-01-20 19:39:09 +00:00
+ltr
2020-08-22 09:54:08 +00:00
border-radius: var(--tabs-boxed-link-radius) var(--tabs-boxed-link-radius) 0 0
2020-01-20 19:39:09 +00:00
+rtl
2020-08-22 09:54:08 +00:00
border-radius: 0 0 var(--tabs-boxed-link-radius) var(--tabs-boxed-link-radius)
2016-01-24 00:03:43 +00:00
&:hover
2020-08-22 09:54:08 +00:00
background-color: var(--tabs-boxed-link-hover-background-color)
border-bottom-color: var(--tabs-boxed-link-hover-border-bottom-color)
2016-01-24 00:03:43 +00:00
li
&.is-active
a
2020-08-22 09:54:08 +00:00
background-color: var(--tabs-boxed-link-active-background-color)
border-color: var(--tabs-boxed-link-active-border-color)
border-bottom-color: var(--tabs-boxed-link-active-border-bottom-color) !important
2016-04-10 15:27:27 +00:00
&.is-fullwidth
li
2016-07-31 10:45:56 +00:00
flex-grow: 1
flex-shrink: 0
2016-01-24 00:03:43 +00:00
&.is-toggle
a
2020-08-22 09:54:08 +00:00
border-color: var(--tabs-toggle-link-border-color)
border-style: var(--tabs-toggle-link-border-style)
border-width: var(--tabs-toggle-link-border-width)
2016-01-24 00:03:43 +00:00
margin-bottom: 0
position: relative
&:hover
2020-08-22 09:54:08 +00:00
background-color: var(--tabs-toggle-link-hover-background-color)
border-color: var(--tabs-toggle-link-hover-border-color)
2016-01-24 00:03:43 +00:00
z-index: 2
li
& + li
2020-08-22 09:54:08 +00:00
+ltr-property("margin", calc(-1 * #{var(--tabs-toggle-link-border-width)}), false)
2016-01-24 00:03:43 +00:00
&:first-child a
2020-01-20 19:39:09 +00:00
+ltr
2020-08-22 09:54:08 +00:00
border-top-left-radius: var(--tabs-toggle-link-radius)
border-bottom-left-radius: var(--tabs-toggle-link-radius)
2020-01-20 19:39:09 +00:00
+rtl
2020-08-22 09:54:08 +00:00
border-top-right-radius: var(--tabs-toggle-link-radius)
border-bottom-right-radius: var(--tabs-toggle-link-radius)
2016-01-24 00:03:43 +00:00
&:last-child a
2020-01-20 19:39:09 +00:00
+ltr
2020-08-22 09:54:08 +00:00
border-top-right-radius: var(--tabs-toggle-link-radius)
border-bottom-right-radius: var(--tabs-toggle-link-radius)
2020-01-20 19:39:09 +00:00
+rtl
2020-08-22 09:54:08 +00:00
border-top-left-radius: var(--tabs-toggle-link-radius)
border-bottom-left-radius: var(--tabs-toggle-link-radius)
2016-01-24 00:03:43 +00:00
&.is-active
a
2020-08-22 09:54:08 +00:00
background-color: var(--tabs-toggle-link-active-background-color)
border-color: var(--tabs-toggle-link-active-border-color)
color: var(--tabs-toggle-link-active-color)
2016-01-24 00:03:43 +00:00
z-index: 1
ul
border-bottom: none
2017-12-04 13:45:14 +00:00
&.is-toggle-rounded
li
&:first-child a
2020-01-20 19:39:09 +00:00
+ltr
2020-08-22 09:54:08 +00:00
border-bottom-left-radius: var(--radius-rounded, #{$radius-rounded})
border-top-left-radius: var(--radius-rounded, #{$radius-rounded})
2020-01-20 19:39:09 +00:00
padding-left: 1.25em
+rtl
2020-08-22 09:54:08 +00:00
border-bottom-right-radius: var(--radius-rounded, #{$radius-rounded})
border-top-right-radius: var(--radius-rounded, #{$radius-rounded})
2020-01-20 19:39:09 +00:00
padding-right: 1.25em
2017-12-04 13:45:14 +00:00
&:last-child a
2020-01-20 19:39:09 +00:00
+ltr
2020-08-22 09:54:08 +00:00
border-bottom-right-radius: var(--radius-rounded, #{$radius-rounded})
border-top-right-radius: var(--radius-rounded, #{$radius-rounded})
2020-01-20 19:39:09 +00:00
padding-right: 1.25em
+rtl
2020-08-22 09:54:08 +00:00
border-bottom-left-radius: var(--radius-rounded, #{$radius-rounded})
border-top-left-radius: var(--radius-rounded, #{$radius-rounded})
2020-01-20 19:39:09 +00:00
padding-left: 1.25em
2016-05-07 22:40:06 +00:00
// Sizes
&.is-small
2020-08-22 09:54:08 +00:00
--tabs-font-size: var(--size-small, #{$size-small})
2016-05-07 22:40:06 +00:00
&.is-medium
2020-08-22 09:54:08 +00:00
--tabs-font-size: var(--size-medium, #{$size-medium})
2016-05-07 22:40:06 +00:00
&.is-large
2020-08-22 09:54:08 +00:00
--tabs-font-size: var(--size-large, #{$size-large})