bulma/sass/components/message.sass

87 lines
2.5 KiB
Sass
Raw Normal View History

2017-07-28 20:05:15 +00:00
$message-background-color: $background !default
$message-radius: $radius !default
$message-header-background-color: $text !default
$message-header-color: $text-invert !default
2018-04-11 15:07:35 +00:00
$message-header-weight: $weight-bold !default
$message-header-padding: 0.75em 1em !default
2017-07-28 20:05:15 +00:00
$message-header-radius: $radius !default
2018-04-11 15:07:35 +00:00
$message-body-border-color: $border !default
$message-body-border-width: 0 0 0 4px !default
2017-07-28 20:05:15 +00:00
$message-body-color: $text !default
2018-04-11 15:07:35 +00:00
$message-body-padding: 1.25em 1.5em !default
2017-07-28 20:05:15 +00:00
$message-body-radius: $radius !default
$message-body-pre-background-color: $white !default
$message-body-pre-code-background-color: transparent !default
2018-04-11 15:07:35 +00:00
$message-header-body-border-width: 0 !default
2016-01-24 00:03:43 +00:00
.message
2018-09-04 13:24:50 +00:00
@extend %block
2017-07-28 20:05:15 +00:00
background-color: $message-background-color
border-radius: $message-radius
2016-10-30 19:20:51 +00:00
font-size: $size-normal
2017-09-18 22:02:43 +00:00
strong
color: currentColor
a:not(.button):not(.tag):not(.dropdown-item)
2017-09-18 22:02:43 +00:00
color: currentColor
text-decoration: underline
2017-07-28 20:05:15 +00:00
// Sizes
&.is-small
font-size: $size-small
&.is-medium
font-size: $size-medium
&.is-large
font-size: $size-large
2016-04-10 15:00:32 +00:00
// Colors
2016-01-24 00:03:43 +00:00
@each $name, $pair in $colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
2016-10-30 19:20:51 +00:00
$color-lightning: max((100% - lightness($color)) - 2%, 0%)
$color-luminance: colorLuminance($color)
$darken-percentage: $color-luminance * 70%
$desaturate-percentage: $color-luminance * 30%
2016-01-24 00:03:43 +00:00
&.is-#{$name}
2016-10-30 19:20:51 +00:00
background-color: lighten($color, $color-lightning)
2016-01-24 00:03:43 +00:00
.message-header
2016-06-29 22:59:48 +00:00
background-color: $color
2016-01-24 00:03:43 +00:00
color: $color-invert
.message-body
border-color: $color
2016-10-30 19:20:51 +00:00
color: desaturate(darken($color, $darken-percentage), $desaturate-percentage)
.message-header
align-items: center
2017-07-28 20:05:15 +00:00
background-color: $message-header-background-color
border-radius: $message-header-radius $message-header-radius 0 0
color: $message-header-color
2016-10-30 19:20:51 +00:00
display: flex
2018-04-11 15:07:35 +00:00
font-weight: $message-header-weight
2016-10-30 19:20:51 +00:00
justify-content: space-between
line-height: 1.25
2017-07-28 20:05:15 +00:00
padding: $message-header-padding
2016-10-30 19:20:51 +00:00
position: relative
.delete
flex-grow: 0
flex-shrink: 0
margin-left: 0.75em
& + .message-body
2018-04-11 15:07:35 +00:00
border-width: $message-header-body-border-width
2016-12-23 12:45:52 +00:00
border-top-left-radius: 0
border-top-right-radius: 0
2016-10-30 19:20:51 +00:00
.message-body
2018-04-11 15:07:35 +00:00
border-color: $message-body-border-color
2017-07-28 20:05:15 +00:00
border-radius: $message-body-radius
2018-04-11 15:07:35 +00:00
border-style: solid
border-width: $message-body-border-width
2017-07-28 20:05:15 +00:00
color: $message-body-color
padding: $message-body-padding
2016-10-30 23:44:50 +00:00
code,
pre
2017-07-28 20:05:15 +00:00
background-color: $message-body-pre-background-color
2016-10-30 23:44:50 +00:00
pre code
2017-07-28 20:05:15 +00:00
background-color: $message-body-pre-code-background-color