Files
2026-01-05 12:47:14 +08:00

127 lines
2.0 KiB
SCSS

@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.nut-toast {
position: relative;
font-family: $font-family;
pointer-events: none;
$block: &;
&-small {
#{$block}-inner {
font-size: $font-size-small;
}
#{$block}-title {
font-size: calc(#{$font-size-small} + 2px);
}
}
&-base {
#{$block}-inner {
font-size: $font-size-base;
}
#{$block}-title {
font-size: calc(#{$font-size-base} + 2px);
}
}
&-large {
#{$block}-inner {
font-size: $font-size-large;
}
#{$block}-title {
font-size: calc(#{$font-size-large} + 2px);
}
}
&-wrapper {
position: fixed;
left: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
}
&-cover {
#{$block}-wrapper {
height: 100%;
pointer-events: auto;
background: $toast-cover-bg-color;
}
&:not(#{$block}-center) {
#{$block}-wrapper {
top: 0;
}
#{$block}-inner {
position: absolute;
}
}
}
&-center {
#{$block}-wrapper {
top: 50%;
transform: translateY(-50%);
}
}
&-inner {
display: flex;
flex-direction: column;
min-width: 40%;
max-width: 65%;
padding: $toast-inner-padding;
color: $toast-font-color;
word-break: break-all;
background: $toast-inner-bg-color;
border-radius: $toast-inner-border-radius;
}
&-loading {
#{$block}-icon-wrapper {
align-self: center;
}
&#{$block}-loading-rotate {
#{$block}-icon-wrapper {
animation: rotation 1s linear infinite;
}
}
}
&-icon-wrapper {
display: flex;
justify-content: center;
.nut-icon-loading {
animation: none;
}
& + #{$block}-title,
& + #{$block}-text {
margin-top: 12px;
}
}
&-title {
& + #{$block}-text {
margin-top: 8px;
}
}
}