| 1 |
@import "../utilities/mixins" |
| 2 |
|
| 3 |
$message-background-color: $background !default |
| 4 |
$message-radius: $radius !default |
| 5 |
|
| 6 |
$message-header-background-color: $text !default |
| 7 |
$message-header-color: $text-invert !default |
| 8 |
$message-header-weight: $weight-bold !default |
| 9 |
$message-header-padding: 0.75em 1em !default |
| 10 |
$message-header-radius: $radius !default |
| 11 |
|
| 12 |
$message-body-border-color: $border !default |
| 13 |
$message-body-border-width: 0 0 0 4px !default |
| 14 |
$message-body-color: $text !default |
| 15 |
$message-body-padding: 1.25em 1.5em !default |
| 16 |
$message-body-radius: $radius !default |
| 17 |
|
| 18 |
$message-body-pre-background-color: $scheme-main !default |
| 19 |
$message-body-pre-code-background-color: transparent !default |
| 20 |
|
| 21 |
$message-header-body-border-width: 0 !default |
| 22 |
$message-colors: $colors !default |
| 23 |
|
| 24 |
.message |
| 25 |
@extend %block |
| 26 |
background-color: $message-background-color |
| 27 |
border-radius: $message-radius |
| 28 |
font-size: $size-normal |
| 29 |
strong |
| 30 |
color: currentColor |
| 31 |
a:not(.button):not(.tag):not(.dropdown-item) |
| 32 |
color: currentColor |
| 33 |
text-decoration: underline |
| 34 |
// Sizes |
| 35 |
&.is-small |
| 36 |
font-size: $size-small |
| 37 |
&.is-medium |
| 38 |
font-size: $size-medium |
| 39 |
&.is-large |
| 40 |
font-size: $size-large |
| 41 |
// Colors |
| 42 |
@each $name, $components in $message-colors |
| 43 |
$color: nth($components, 1) |
| 44 |
$color-invert: nth($components, 2) |
| 45 |
$color-light: null |
| 46 |
$color-dark: null |
| 47 |
|
| 48 |
@if length($components) >= 3 |
| 49 |
$color-light: nth($components, 3) |
| 50 |
@if length($components) >= 4 |
| 51 |
$color-dark: nth($components, 4) |
| 52 |
@else |
| 53 |
$color-luminance: colorLuminance($color) |
| 54 |
$darken-percentage: $color-luminance * 70% |
| 55 |
$desaturate-percentage: $color-luminance * 30% |
| 56 |
$color-dark: desaturate(darken($color, $darken-percentage), $desaturate-percentage) |
| 57 |
@else |
| 58 |
$color-lightning: max((100% - lightness($color)) - 2%, 0%) |
| 59 |
$color-light: lighten($color, $color-lightning) |
| 60 |
|
| 61 |
&.is-#{$name} |
| 62 |
background-color: $color-light |
| 63 |
.message-header |
| 64 |
background-color: $color |
| 65 |
color: $color-invert |
| 66 |
.message-body |
| 67 |
border-color: $color |
| 68 |
color: $color-dark |
| 69 |
|
| 70 |
.message-header |
| 71 |
align-items: center |
| 72 |
background-color: $message-header-background-color |
| 73 |
border-radius: $message-header-radius $message-header-radius 0 0 |
| 74 |
color: $message-header-color |
| 75 |
display: flex |
| 76 |
font-weight: $message-header-weight |
| 77 |
justify-content: space-between |
| 78 |
line-height: 1.25 |
| 79 |
padding: $message-header-padding |
| 80 |
position: relative |
| 81 |
.delete |
| 82 |
flex-grow: 0 |
| 83 |
flex-shrink: 0 |
| 84 |
+ltr-property("margin", 0.75em, false) |
| 85 |
& + .message-body |
| 86 |
border-width: $message-header-body-border-width |
| 87 |
border-top-left-radius: 0 |
| 88 |
border-top-right-radius: 0 |
| 89 |
|
| 90 |
.message-body |
| 91 |
border-color: $message-body-border-color |
| 92 |
border-radius: $message-body-radius |
| 93 |
border-style: solid |
| 94 |
border-width: $message-body-border-width |
| 95 |
color: $message-body-color |
| 96 |
padding: $message-body-padding |
| 97 |
code, |
| 98 |
pre |
| 99 |
background-color: $message-body-pre-background-color |
| 100 |
pre code |
| 101 |
background-color: $message-body-pre-code-background-color |