naive-ui/styles/Notification.scss

210 lines
5.6 KiB
SCSS
Raw Normal View History

2019-06-20 19:10:53 +08:00
@import './mixins/mixins.scss';
@include b(notification-container) {
z-index: 4000;
position: fixed;
2019-12-08 20:47:14 +08:00
top: 12px;
left: 0;
right: 0;
height: 0;
overflow: visible;
display: flex;
flex-direction: column;
align-items: flex-end;
2020-01-22 16:29:34 +08:00
& > {
@include b(scrollbar) {
height: -moz-fit-content !important;
height: fit-content !important;
max-height: 100vh !important;
& > {
@include b(scrollbar-container) {
height: -moz-fit-content !important;
height: fit-content !important;
max-height: 100vh !important;
@include b(scrollbar-content) {
padding-top: 12px;
}
}
}
}
}
2020-01-22 16:29:34 +08:00
2019-12-08 20:47:14 +08:00
@include m(scrollable) {
top: 0;
}
}
2019-12-08 20:47:14 +08:00
@mixin notification-type-mixin ($type) {
@include m($type + '-type') {
@include e(avatar) {
@include b(icon) {
fill: map-get($--notification-avatar-fill, $type);
2020-02-07 20:04:20 +08:00
stroke: map-get($--notification-avatar-fill, $type);
}
}
2019-12-08 20:47:14 +08:00
}
}
@include themes-mixin {
@include b(notification) {
@include notification-type-mixin(success);
@include notification-type-mixin(info);
@include notification-type-mixin(warning);
@include notification-type-mixin(error);
@include notification-type-mixin(default);
background-color: $--notification-background-color;
color: $--notification-text-color;
2019-12-15 22:34:35 +08:00
@include once {
transition:
2019-12-23 21:40:45 +08:00
background-color .3s $--n-ease-in-out-cubic-bezier,
color .3s $--n-ease-in-out-cubic-bezier,
opacity .3s $--n-ease-in-out-cubic-bezier,
transform .3s $--n-ease-in-out-cubic-bezier,
max-height .3s $--n-ease-in-out-cubic-bezier,
margin-bottom .3s linear,
box-shadow .3s $--n-ease-in-out-cubic-bezier;
2020-02-22 14:11:34 +08:00
font-family: inherit;
2019-12-08 20:47:14 +08:00
font-size: 14px;
font-weight: 400;
position: relative;
display: flex;
overflow: hidden;
flex-shrink: 0;
margin-bottom: 12px;
margin-left: 12px;
margin-right: 16px;
padding-left: 16px;
padding-right: 16px;
width: 365px;
2020-02-28 22:57:10 +08:00
border-radius: $--n-notification-border-radius;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.18);
box-sizing: border-box;
opacity: 1;
&-transition-enter, &-transition-leave-to {
opacity: 0;
margin-bottom: 0;
transform: translateX(calc(100% + 16px));
}
&-transition-leave, &-transition-enter-to {
opacity: 1;
transform: translateX(0);
}
2019-12-08 20:47:14 +08:00
@include m(no-avatar) {
@include b(notification-main) {
margin-left: 8px;
width: calc(100% - 8px);
}
}
@include m(closable) {
@include b(notification-main) {
& > *:first-child {
padding-right: 20px
}
}
}
}
@include e(close) {
@include once {
position: absolute;
top: 16px;
2019-12-08 20:47:14 +08:00
right: 12px;
font-size: 20px;
cursor: pointer;
}
2019-12-08 20:47:14 +08:00
@include b(icon) {
2020-03-05 22:31:20 +08:00
fill: map-get($--notification-close-color, 'default');
stroke: map-get($--notification-close-color, 'default');
}
&:hover {
@include b(icon) {
fill: map-get($--notification-close-color, 'hover');
stroke: map-get($--notification-close-color, 'hover');
}
}
&:active {
@include b(icon) {
fill: map-get($--notification-close-color, 'active');
stroke: map-get($--notification-close-color, 'active');
}
2019-12-08 20:47:14 +08:00
}
}
@include e(avatar) {
@include once {
position: absolute;
top: 16px;
left: 16px;
width: 28px;
height: 28px;
font-size: 28px;
}
}
@include b(notification-main) {
@include once {
padding-top: 16px;
padding-bottom: 16px;
box-sizing: border-box;
display: flex;
flex-direction: column;
margin-left: 40px;
width: calc(100% - 40px);
2019-12-08 20:47:14 +08:00
@include b(notification-main-footer) {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 8px;
2019-06-21 00:34:24 +08:00
}
}
@include e(header) {
2019-12-08 20:47:14 +08:00
@include once {
2020-02-27 23:02:58 +08:00
font-weight: $--n-strong-weight;
2019-12-08 20:47:14 +08:00
font-size: 16px;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-12-08 20:47:14 +08:00
}
color: $--notification-header-text-color;
}
@include e(description) {
2019-12-08 20:47:14 +08:00
@include once {
margin-top: 8px;
font-size: 12px;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-12-08 20:47:14 +08:00
}
color: $--notification-description-text-color;
}
@include e(content) {
2019-12-08 20:47:14 +08:00
@include once {
2020-02-23 11:00:31 +08:00
line-height: 1.75;
2019-12-08 20:47:14 +08:00
margin: 12px 0 0 0;
font-family: inherit;
&:first-child {
margin: 0;
}
white-space: pre-wrap;
word-wrap: break-word;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-12-08 20:47:14 +08:00
}
color: $--notification-content-text-color;
}
@include b(notification-main-footer) {
2019-12-08 20:47:14 +08:00
@include once {
margin-top: 12px;
}
@include e(meta) {
2019-12-08 20:47:14 +08:00
@include once {
font-size: 12px;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-12-08 20:47:14 +08:00
}
color: $--notification-description-text-color;
2019-06-28 15:08:31 +08:00
}
@include e(action) {
2019-12-08 20:47:14 +08:00
@include once {
cursor: pointer;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-12-08 20:47:14 +08:00
}
color: $--notification-action-text-color;
2019-06-20 19:10:53 +08:00
}
}
}
}
}