bulma/sass/components/modal.sass

139 lines
4.5 KiB
Sass
Raw Permalink Normal View History

$modal-z: 40 !default
2017-07-28 20:05:15 +00:00
2020-08-22 09:32:55 +00:00
$modal-background-background-color: rgba(var(--scheme-invert-rgb, #{bulmaToRGB($black)}), 0.86) !default
2017-07-28 20:05:15 +00:00
$modal-content-width: 640px !default
$modal-content-margin-mobile: 20px !default
$modal-content-spacing-mobile: 160px !default
$modal-content-spacing-tablet: 40px !default
$modal-close-dimensions: 40px !default
$modal-close-right: 20px !default
$modal-close-top: 20px !default
$modal-card-spacing: 40px !default
2020-08-22 09:32:55 +00:00
$modal-card-head-background-color: var(--background, #{$background}) !default
2017-07-28 20:05:15 +00:00
$modal-card-head-border-bottom: 1px solid $border !default
$modal-card-head-padding: 20px !default
2020-08-22 09:32:55 +00:00
$modal-card-head-radius: var(--radius-large, #{$radius-large}) !default
2017-07-28 20:05:15 +00:00
2020-08-22 09:32:55 +00:00
$modal-card-title-color: var(--text-strong, #{$text-strong}) !default
2017-07-28 20:05:15 +00:00
$modal-card-title-line-height: 1 !default
$modal-card-title-size: $size-4 !default
2020-08-22 09:32:55 +00:00
$modal-card-foot-radius: var(--radius-large, #{$radius-large}) !default
2017-07-28 20:05:15 +00:00
$modal-card-foot-border-top: 1px solid $border !default
2020-08-22 09:32:55 +00:00
$modal-card-body-background-color: var(--scheme-main, #{$scheme-main}) !default
2017-07-28 20:05:15 +00:00
$modal-card-body-padding: 20px !default
2020-09-02 20:54:33 +00:00
$modal-breakpoint: $tablet !default
2017-07-28 20:05:15 +00:00
.modal
2020-08-22 09:32:55 +00:00
--modal-z: #{$modal-z}
--modal-background-background-color: #{$modal-background-background-color}
--modal-content-width: #{$modal-content-width}
--modal-content-margin-mobile: #{$modal-content-margin-mobile}
--modal-content-spacing-mobile: #{$modal-content-spacing-mobile}
--modal-content-spacing-tablet: #{$modal-content-spacing-tablet}
--modal-close-dimensions: #{$modal-close-dimensions}
--modal-close-right: #{$modal-close-right}
--modal-close-top: #{$modal-close-top}
--modal-card-spacing: #{$modal-card-spacing}
--modal-card-head-background-color: #{$modal-card-head-background-color}
--modal-card-head-padding: #{$modal-card-head-padding}
--modal-card-head-border-bottom: #{$modal-card-head-border-bottom}
--modal-card-head-radius: #{$modal-card-head-radius}
--modal-card-head-radius: #{$modal-card-head-radius}
--modal-card-title-color: #{$modal-card-title-color}
--modal-card-title-size: #{$modal-card-title-size}
--modal-card-title-line-height: #{$modal-card-title-line-height}
--modal-card-foot-radius: #{$modal-card-foot-radius}
--modal-card-foot-radius: #{$modal-card-foot-radius}
--modal-card-foot-border-top: #{$modal-card-foot-border-top}
--modal-card-body-background-color: #{$modal-card-body-background-color}
--modal-card-body-padding: #{$modal-card-body-padding}
2018-09-04 13:24:50 +00:00
@extend %overlay
2017-07-28 20:05:15 +00:00
align-items: center
display: none
flex-direction: column
2017-07-28 20:05:15 +00:00
justify-content: center
overflow: hidden
position: fixed
2020-08-22 09:32:55 +00:00
z-index: var(--modal-z)
2017-07-28 20:05:15 +00:00
// Modifiers
&.is-active
display: flex
.modal-background
2018-09-04 13:24:50 +00:00
@extend %overlay
2020-08-22 09:32:55 +00:00
background-color: var(--modal-background-background-color)
2016-09-22 21:03:22 +00:00
.modal-content,
.modal-card
2020-08-22 09:32:55 +00:00
margin: 0 var(--modal-content-margin-mobile)
max-height: calc(100vh - #{var(--modal-content-spacing-mobile)})
overflow: auto
position: relative
width: 100%
2016-04-10 15:27:27 +00:00
// Responsiveness
2020-09-02 20:54:33 +00:00
+from($modal-breakpoint)
margin: 0 auto
2020-08-22 09:32:55 +00:00
max-height: calc(100vh - #{var(--modal-content-spacing-tablet)})
width: var(--modal-content-width)
.modal-close
2018-09-04 13:24:50 +00:00
@extend %delete
background: none
2020-08-22 09:32:55 +00:00
height: var(--modal-close-dimensions)
position: fixed
2020-08-22 09:32:55 +00:00
+ltr-position(var(--modal-close-right))
top: var(--modal-close-top)
width: var(--modal-close-dimensions)
.modal-card
display: flex
flex-direction: column
2020-08-22 09:32:55 +00:00
max-height: calc(100vh - #{var(--modal-card-spacing)})
overflow: hidden
2018-06-01 12:17:53 +00:00
-ms-overflow-y: visible
.modal-card-head,
.modal-card-foot
align-items: center
2020-08-22 09:32:55 +00:00
background-color: var(--modal-card-head-background-color)
display: flex
flex-shrink: 0
justify-content: flex-start
2020-08-22 09:32:55 +00:00
padding: var(--modal-card-head-padding)
position: relative
.modal-card-head
2020-08-22 09:32:55 +00:00
border-bottom: var(--modal-card-head-border-bottom)
border-top-left-radius: var(--modal-card-head-radius)
border-top-right-radius: var(--modal-card-head-radius)
.modal-card-title
2020-08-22 09:32:55 +00:00
color: var(--modal-card-title-color)
2016-07-31 10:45:56 +00:00
flex-grow: 1
flex-shrink: 0
2020-08-22 09:32:55 +00:00
font-size: var(--modal-card-title-size)
line-height: var(--modal-card-title-line-height)
.modal-card-foot
2020-08-22 09:32:55 +00:00
border-bottom-left-radius: var(--modal-card-foot-radius)
border-bottom-right-radius: var(--modal-card-foot-radius)
border-top: var(--modal-card-foot-border-top)
.button
&:not(:last-child)
2020-01-22 09:14:04 +00:00
+ltr-property("margin", 0.5em)
.modal-card-body
2016-12-22 19:51:52 +00:00
+overflow-touch
2020-08-22 09:32:55 +00:00
background-color: var(--modal-card-body-background-color)
2016-07-31 10:45:56 +00:00
flex-grow: 1
flex-shrink: 1
overflow: auto
2020-08-22 09:32:55 +00:00
padding: var(--modal-card-body-padding)