mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
82 lines
2.1 KiB
SCSS
82 lines
2.1 KiB
SCSS
@import './mixins/mixins.scss';
|
|
|
|
@mixin message-type-mixin ($type) {
|
|
@include m($type) {
|
|
background-color: map-get($map: $--message-background-color, $key: $type);
|
|
box-shadow: map-get($map: $--message-box-shadow, $key: $type);
|
|
@include e(icon) {
|
|
i::before {
|
|
color: $--message-icon-color;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@include themes-mixin {
|
|
@include b(message-container) {
|
|
@include once {
|
|
position: fixed;
|
|
left: 0;
|
|
right: 0;
|
|
height: 0;
|
|
overflow: visible;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
@include b(message) {
|
|
@include once {
|
|
display: flex;
|
|
transition: opacity .3s $default-cubic-bezier, transform .3s $default-cubic-bezier, max-height .3s $default-cubic-bezier, margin-bottom .3s $default-cubic-bezier;
|
|
max-height: 40px;
|
|
opacity: 1;
|
|
margin-bottom: 12px;
|
|
padding: 0 40px;
|
|
height: 40px;
|
|
border-radius: 20px;
|
|
flex-shrink: 0;
|
|
font-weight: 700;
|
|
overflow: hidden;
|
|
}
|
|
color: $--message-text-color;
|
|
@include once {
|
|
@include e(content) {
|
|
display: inline-block;
|
|
height: 40px;
|
|
line-height: 40px;
|
|
}
|
|
@include e(icon) {
|
|
margin-right: 10px;
|
|
display: inline-flex;
|
|
height: 40px;
|
|
line-height: 40px;
|
|
align-items: center;
|
|
i::before {
|
|
font-size: 20px;
|
|
}
|
|
}
|
|
}
|
|
@include once {
|
|
@include m(enter) {
|
|
opacity: 0;
|
|
transform: translateY(-12px) scale(.5);
|
|
transform-origin: top center;
|
|
max-height: 0px;
|
|
margin-bottom: 0;
|
|
}
|
|
@include m(leave) {
|
|
opacity: 0;
|
|
transform-origin: top center;
|
|
transform: translateY(-12px) scale(.5);
|
|
max-height: 0px;
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
@include message-type-mixin('info');
|
|
@include message-type-mixin('success');
|
|
@include message-type-mixin('error');
|
|
@include message-type-mixin('warning');
|
|
}
|
|
}
|
|
}
|