naive-ui/styles/Message.scss

81 lines
2.1 KiB
SCSS
Raw Normal View History

2019-06-19 17:43:57 +08:00
@import './mixins/mixins.scss';
2019-10-08 13:34:34 +08:00
@mixin message-type-mixin ($type) {
@include m($type + '-type') {
color: map-get($--message-text-color, $type);
2019-10-08 13:34:34 +08:00
background-color: map-get($map: $--message-background-color, $key: $type);
box-shadow: map-get($map: $--message-box-shadow, $key: $type);
@include e(icon) {
2019-12-20 19:02:23 +08:00
@include b(icon) {
2019-10-24 18:04:31 +08:00
fill: $--message-icon-color;
2019-06-19 17:43:57 +08:00
}
2019-10-08 13:34:34 +08:00
}
}
}
2019-12-06 18:23:01 +08:00
@include b(message-container) {
@include once {
2019-12-13 18:18:35 +08:00
z-index: 6000;
2019-12-06 18:23:01 +08:00
position: fixed;
top: 12px;
2019-12-06 18:23:01 +08:00
left: 0;
right: 0;
height: 0;
overflow: visible;
display: flex;
flex-direction: column;
align-items: center;
}
}
2019-10-08 13:34:34 +08:00
@include themes-mixin {
2019-12-06 18:23:01 +08:00
@include b(message) {
2019-10-08 13:34:34 +08:00
@include once {
display: flex;
transition: color .3s $default-cubic-bezier, box-shadow .3s $default-cubic-bezier, background-color .3s $default-cubic-bezier, opacity .3s $default-cubic-bezier, transform .3s $default-cubic-bezier, max-height .3s $default-cubic-bezier, margin-bottom .3s $default-cubic-bezier;
2019-12-06 18:23:01 +08:00
max-height: 40px;
opacity: 1;
margin-bottom: 12px;
padding: 0 40px;
height: 40px;
border-radius: 20px;
flex-shrink: 0;
font-weight: 700;
overflow: hidden;
2019-12-09 15:12:53 +08:00
&#{&}-transition-enter, &#{&}-transition-leave-to {
opacity: 0;
transform: translateY(-12px) scale(.5);
transform-origin: top center;
max-height: 0;
margin-bottom: 0;
}
2019-10-08 13:34:34 +08:00
}
2019-12-06 18:23:01 +08:00
@include once {
@include e(content) {
display: inline-block;
2019-06-19 17:43:57 +08:00
height: 40px;
2019-12-06 18:23:01 +08:00
line-height: 40px;
font-size: 15px;
2019-06-28 15:38:44 +08:00
}
2019-12-06 18:23:01 +08:00
@include e(icon) {
margin-right: 10px;
display: inline-flex;
height: 40px;
line-height: 40px;
align-items: center;
2019-12-20 19:02:23 +08:00
@include b(icon) {
svg {
@include icon-switch-transition();
}
2019-12-06 18:23:01 +08:00
font-size: 20px;
2019-06-19 17:43:57 +08:00
}
2019-06-28 15:38:44 +08:00
}
2019-12-06 18:23:01 +08:00
}
@include message-type-mixin('info');
@include message-type-mixin('success');
@include message-type-mixin('error');
@include message-type-mixin('warning');
@include message-type-mixin('loading');
2019-06-19 17:43:57 +08:00
}
2019-10-08 13:34:34 +08:00
}