2024-03-21 16:11:54 +00:00
|
|
|
@use "../utilities/css-variables" as cv;
|
|
|
|
|
@use "../utilities/derived-variables" as dv;
|
|
|
|
|
@use "../utilities/initial-variables" as iv;
|
|
|
|
|
@use "../utilities/extends";
|
|
|
|
|
@use "../utilities/mixins" as mx;
|
|
|
|
|
|
2024-09-18 23:53:25 +01:00
|
|
|
$message-background-color: cv.getVar("background");
|
2024-03-21 16:11:54 +00:00
|
|
|
$message-background-l: cv.getVar("background-l");
|
2024-09-18 23:53:25 +01:00
|
|
|
$message-color: cv.getVar("text") !default;
|
|
|
|
|
$message-border-color: cv.getVar("border");
|
2024-03-21 16:11:54 +00:00
|
|
|
$message-border-style: solid;
|
|
|
|
|
$message-border-width: 0.25em;
|
2024-09-18 23:53:25 +01:00
|
|
|
$message-header-background-color: cv.getVar("text");
|
|
|
|
|
$message-header-color: cv.getVar("text-invert");
|
|
|
|
|
$message-radius: cv.getVar("radius-large") !default;
|
2024-03-21 16:11:54 +00:00
|
|
|
|
|
|
|
|
$message-header-weight: cv.getVar("weight-semibold") !default;
|
|
|
|
|
$message-header-padding: 1em 1.25em !default;
|
2024-09-18 23:53:25 +01:00
|
|
|
$message-header-radius: cv.getVar("radius-large") !default;
|
2024-03-21 16:11:54 +00:00
|
|
|
|
|
|
|
|
$message-body-border-width: 0 0 0 4px !default;
|
|
|
|
|
$message-body-color: cv.getVar("text") !default;
|
|
|
|
|
$message-body-padding: 1.25em 1.5em !default;
|
2024-09-18 23:53:25 +01:00
|
|
|
$message-body-radius: cv.getVar("radius-medium") !default;
|
2024-03-21 16:11:54 +00:00
|
|
|
|
|
|
|
|
$message-body-pre-code-background-color: transparent !default;
|
|
|
|
|
|
|
|
|
|
$message-header-body-border-width: 0 !default;
|
|
|
|
|
$message-colors: dv.$colors !default;
|
|
|
|
|
|
|
|
|
|
.#{iv.$class-prefix}message {
|
|
|
|
|
@include cv.register-vars(
|
|
|
|
|
(
|
2024-09-18 23:53:25 +01:00
|
|
|
"message-background-color": #{$message-background-color},
|
|
|
|
|
"message-background-l": #{$message-background-l},
|
|
|
|
|
"message-color": #{$message-color},
|
|
|
|
|
"message-border-color": #{$message-border-color},
|
2024-03-21 16:11:54 +00:00
|
|
|
"message-radius": #{$message-radius},
|
|
|
|
|
"message-header-weight": #{$message-header-weight},
|
|
|
|
|
"message-header-padding": #{$message-header-padding},
|
|
|
|
|
"message-header-radius": #{$message-header-radius},
|
|
|
|
|
"message-body-border-width": #{$message-body-border-width},
|
|
|
|
|
"message-body-color": #{$message-body-color},
|
|
|
|
|
"message-body-padding": #{$message-body-padding},
|
|
|
|
|
"message-body-radius": #{$message-body-radius},
|
|
|
|
|
"message-body-pre-code-background-color": #{$message-body-pre-code-background-color},
|
|
|
|
|
"message-header-body-border-width": #{$message-header-body-border-width},
|
|
|
|
|
"message-border-style": #{$message-border-style},
|
|
|
|
|
"message-border-width": #{$message-border-width},
|
2024-09-18 23:53:25 +01:00
|
|
|
"message-header-background-color": #{$message-header-background-color},
|
|
|
|
|
"message-header-color": #{$message-header-color},
|
2024-03-21 16:11:54 +00:00
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{iv.$class-prefix}message {
|
|
|
|
|
@extend %block;
|
|
|
|
|
border-radius: cv.getVar("message-radius");
|
2024-09-18 23:53:25 +01:00
|
|
|
color: cv.getVar("message-color");
|
2024-03-21 16:11:54 +00:00
|
|
|
font-size: cv.getVar("size-normal");
|
|
|
|
|
|
|
|
|
|
strong {
|
|
|
|
|
color: currentColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
a:not(.#{iv.$class-prefix}button):not(.#{iv.$class-prefix}tag):not(
|
|
|
|
|
.#{iv.$class-prefix}dropdown-item
|
|
|
|
|
) {
|
|
|
|
|
color: currentColor;
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Sizes
|
|
|
|
|
&.#{iv.$class-prefix}is-small {
|
|
|
|
|
font-size: cv.getVar("size-small");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.#{iv.$class-prefix}is-medium {
|
|
|
|
|
font-size: cv.getVar("size-medium");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.#{iv.$class-prefix}is-large {
|
|
|
|
|
font-size: cv.getVar("size-large");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Colors
|
|
|
|
|
@each $name, $components in $message-colors {
|
|
|
|
|
&.#{iv.$class-prefix}is-#{$name} {
|
|
|
|
|
@include cv.register-vars(
|
|
|
|
|
(
|
2024-09-18 23:53:25 +01:00
|
|
|
"message-background-color": #{cv.getVar($name, "", "-light")},
|
|
|
|
|
"message-border-color": #{cv.getVar($name)},
|
|
|
|
|
"message-color": #{cv.getVar($name, "", "-on-scheme")},
|
|
|
|
|
"message-header-background-color": #{cv.getVar($name)},
|
|
|
|
|
"message-header-color": #{cv.getVar($name, "", "-invert")},
|
2024-03-21 16:11:54 +00:00
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{iv.$class-prefix}message-header {
|
|
|
|
|
align-items: center;
|
2024-09-18 23:53:25 +01:00
|
|
|
background-color: cv.getVar("message-header-background-color");
|
2024-03-21 16:11:54 +00:00
|
|
|
border-start-start-radius: cv.getVar("message-header-radius");
|
|
|
|
|
border-start-end-radius: cv.getVar("message-header-radius");
|
2024-09-18 23:53:25 +01:00
|
|
|
color: cv.getVar("message-header-color");
|
2024-03-21 16:11:54 +00:00
|
|
|
display: flex;
|
|
|
|
|
font-weight: cv.getVar("message-header-weight");
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
line-height: 1.25;
|
|
|
|
|
padding: cv.getVar("message-header-padding");
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
.#{iv.$class-prefix}delete {
|
|
|
|
|
flex-grow: 0;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
margin-inline-start: 0.75em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
& + .#{iv.$class-prefix}message-body {
|
|
|
|
|
border-width: cv.getVar("message-header-body-border-width");
|
|
|
|
|
border-start-start-radius: 0;
|
|
|
|
|
border-start-end-radius: 0;
|
2024-09-18 23:53:25 +01:00
|
|
|
border-end-end-radius: cv.getVar("message-radius");
|
|
|
|
|
border-end-start-radius: cv.getVar("message-radius");
|
2024-03-21 16:11:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{iv.$class-prefix}message-body {
|
|
|
|
|
background-color: hsl(
|
2024-09-18 23:53:25 +01:00
|
|
|
from #{cv.getVar("message-background-color")} h s #{cv.getVar(
|
|
|
|
|
"message-background-l"
|
|
|
|
|
)}
|
2024-03-21 16:11:54 +00:00
|
|
|
);
|
2024-09-18 23:53:25 +01:00
|
|
|
border-inline-start-color: cv.getVar("message-border-color");
|
2024-03-21 16:11:54 +00:00
|
|
|
border-inline-start-style: #{cv.getVar("message-border-style")};
|
|
|
|
|
border-inline-start-width: #{cv.getVar("message-border-width")};
|
2024-09-18 23:53:25 +01:00
|
|
|
border-start-start-radius: 0;
|
|
|
|
|
border-start-end-radius: cv.getVar("message-radius");
|
|
|
|
|
border-end-end-radius: cv.getVar("message-radius");
|
|
|
|
|
border-end-start-radius: 0;
|
2024-03-21 16:11:54 +00:00
|
|
|
padding: cv.getVar("message-body-padding");
|
|
|
|
|
|
|
|
|
|
code,
|
|
|
|
|
pre {
|
2024-09-18 23:53:25 +01:00
|
|
|
background-color: cv.getVar("message-header-color");
|
|
|
|
|
color: cv.getVar("message-header-background-color");
|
2024-03-21 16:11:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pre code {
|
|
|
|
|
background-color: cv.getVar("message-body-pre-code-background-color");
|
|
|
|
|
}
|
|
|
|
|
}
|