bulma/sass/layout/hero.sass

154 lines
3.6 KiB
Sass
Raw Normal View History

2020-10-31 23:52:27 +00:00
@import "../utilities/mixins"
$hero-body-padding: 3rem 1.5rem !default
$hero-body-padding-tablet: 3rem 3rem !default
$hero-body-padding-small: 1.5rem !default
$hero-body-padding-medium: 9rem 4.5rem !default
$hero-body-padding-large: 18rem 6rem !default
2016-05-07 22:40:06 +00:00
$hero-colors: $colors !default
// Main container
2016-01-24 00:03:43 +00:00
.hero
2016-05-07 22:40:06 +00:00
align-items: stretch
display: flex
flex-direction: column
justify-content: space-between
2017-10-09 11:27:08 +00:00
.navbar
2016-01-24 00:03:43 +00:00
background: none
.tabs
ul
border-bottom: none
2016-04-10 15:56:27 +00:00
// Colors
@each $name, $pair in $hero-colors
2016-01-24 00:03:43 +00:00
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
2016-06-29 22:59:48 +00:00
background-color: $color
2016-01-24 00:03:43 +00:00
color: $color-invert
a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),
2016-12-23 12:13:50 +00:00
strong
color: inherit
2016-01-24 00:03:43 +00:00
.title
color: $color-invert
.subtitle
2020-01-05 13:27:54 +00:00
color: bulmaRgba($color-invert, 0.9)
2017-04-02 12:42:13 +00:00
a:not(.button),
2016-01-24 00:03:43 +00:00
strong
color: $color-invert
2017-10-09 11:27:08 +00:00
.navbar-menu
+touch
2016-06-29 22:59:48 +00:00
background-color: $color
2017-10-09 11:27:08 +00:00
.navbar-item,
.navbar-link
2020-01-05 13:27:54 +00:00
color: bulmaRgba($color-invert, 0.7)
2017-10-09 11:27:08 +00:00
a.navbar-item,
.navbar-link
2016-01-24 00:03:43 +00:00
&:hover,
&.is-active
2020-03-16 02:29:44 +00:00
background-color: bulmaDarken($color, 5%)
2016-03-25 13:38:40 +00:00
color: $color-invert
2016-01-24 00:03:43 +00:00
.tabs
a
color: $color-invert
2016-09-22 18:48:42 +00:00
opacity: 0.9
2016-01-24 00:03:43 +00:00
&:hover
opacity: 1
2016-05-07 22:40:06 +00:00
li
&.is-active a
2021-02-23 14:06:27 +00:00
color: $color !important
2016-05-07 22:40:06 +00:00
opacity: 1
&.is-boxed,
&.is-toggle
2016-01-24 00:03:43 +00:00
a
color: $color-invert
&:hover
2020-01-05 13:27:54 +00:00
background-color: bulmaRgba($scheme-invert, 0.1)
2016-01-24 00:03:43 +00:00
li.is-active a
&,
&:hover
2016-06-29 22:59:48 +00:00
background-color: $color-invert
2016-05-08 00:35:43 +00:00
border-color: $color-invert
2016-01-24 00:03:43 +00:00
color: $color
2016-04-10 15:56:27 +00:00
// Modifiers
2020-03-16 02:29:44 +00:00
@if type-of($color) == 'color'
&.is-bold
$gradient-top-left: darken(saturate(adjust-hue($color, -10deg), 10%), 10%)
$gradient-bottom-right: lighten(saturate(adjust-hue($color, 10deg), 5%), 5%)
background-image: linear-gradient(141deg, $gradient-top-left 0%, $color 71%, $gradient-bottom-right 100%)
+mobile
.navbar-menu
background-image: linear-gradient(141deg, $gradient-top-left 0%, $color 71%, $gradient-bottom-right 100%)
2016-04-10 15:56:27 +00:00
// Sizes
&.is-small
.hero-body
padding: $hero-body-padding-small
2016-01-24 00:03:43 +00:00
&.is-medium
+tablet
2016-05-07 22:40:06 +00:00
.hero-body
padding: $hero-body-padding-medium
2016-05-07 22:40:06 +00:00
&.is-large
+tablet
.hero-body
padding: $hero-body-padding-large
&.is-halfheight,
&.is-fullheight,
&.is-fullheight-with-navbar
2016-05-07 22:40:06 +00:00
.hero-body
2016-05-08 00:35:43 +00:00
align-items: center
2016-01-24 12:32:11 +00:00
display: flex
2016-05-08 00:35:43 +00:00
& > .container
2016-07-31 10:45:56 +00:00
flex-grow: 1
2016-09-24 17:56:26 +00:00
flex-shrink: 1
&.is-halfheight
min-height: 50vh
&.is-fullheight
min-height: 100vh
2017-07-28 20:05:15 +00:00
// Components
.hero-video
2018-09-04 13:24:50 +00:00
@extend %overlay
2017-07-28 20:05:15 +00:00
overflow: hidden
video
left: 50%
min-height: 100%
min-width: 100%
position: absolute
top: 50%
transform: translate3d(-50%, -50%, 0)
// Modifiers
&.is-transparent
opacity: 0.3
// Responsiveness
+mobile
display: none
.hero-buttons
margin-top: 1.5rem
// Responsiveness
+mobile
.button
display: flex
&:not(:last-child)
margin-bottom: 0.75rem
+tablet
display: flex
justify-content: center
.button:not(:last-child)
2020-05-17 18:38:47 +00:00
+ltr-property("margin", 1.5rem)
2017-07-28 20:05:15 +00:00
// Containers
.hero-head,
.hero-foot
flex-grow: 0
flex-shrink: 0
.hero-body
flex-grow: 1
flex-shrink: 0
padding: $hero-body-padding
+tablet
padding: $hero-body-padding-tablet