Files
workspace/code/base-project/base-vue/packages/ao-design/src/modal/index.scss
T
2025-09-21 21:52:08 +08:00

165 lines
3.4 KiB
SCSS

@use '../_styles/_variables.scss' as *;
$modal-prefix: '#{$prefix}-modal';
$btn-prefix: '#{$prefix}-btn';
.#{$modal-prefix}-container {
position: fixed;
inset: 0;
pointer-events: auto;
outline: none;
width: 100%;
height: 100%;
.#{$modal-prefix}-mask {
position: fixed;
inset: 0;
background: $bg-color-mask;
pointer-events: auto;
width: 100%;
height: 100%;
}
.#{$modal-prefix}-position-top {
align-items: flex-start;
padding-top: 20vh;
}
.#{$modal-prefix}-position-center {
align-items: center;
}
.#{$modal-prefix}-position-bottom {
align-items: flex-end;
padding-bottom: 20vh;
}
.#{$modal-prefix}-wrapper {
position: relative;
overflow: auto;
display: flex;
justify-content: center;
width: 100%;
height: 100%;
overflow: visible;
pointer-events: none;
.#{$modal-prefix} {
background: #fff;
border-radius: 4px;
overflow: hidden;
font-size: 14px;
margin: 0;
width: 480px;
height: 300px;
display: flex;
flex-direction: column;
pointer-events: auto;
&-header {
display: flex;
flex-shrink: 0;
align-items: center;
width: 100%;
font-size: 16px;
padding: 12px 16px;
word-break: break-all;
.#{$modal-prefix}-icon:first-of-type {
margin-left: auto;
}
.#{$modal-prefix}-icon {
flex-shrink: 0;
color: $text-color-assist;
cursor: pointer;
border-radius: $border-radius;
width: 20px;
height: 20px;
& + .#{$modal-prefix}-icon {
margin-left: 8px;
}
&:hover {
background-color: $default-color-hover;
}
}
}
&-title {
display: flex;
align-items: center;
line-height: 1;
flex: 1;
min-width: 0; // 防止内容过长撑破布局
}
&-type {
font-size: 24px;
margin-right: 6px;
&-info {
color: $primary-color;
}
&-success {
color: $success-color;
}
&-warning {
color: $warning-color;
}
&-danger {
color: $danger-color;
}
&-question {
color: $primary-color;
}
}
&-body {
flex: 1 1 auto;
padding: 12px 16px;
overflow-y: auto;
}
&-footer {
padding: 12px 16px;
flex-shrink: 0;
text-align: right;
.#{$btn-prefix}:not(:first-child) {
margin-left: 12px;
}
}
}
.#{$modal-prefix}-fullscreen {
width: 100%;
height: 100%;
}
}
}
/* 内容动画 - 修复版 */
.#{$modal-prefix}-content-fade-enter-active,
.#{$modal-prefix}-content-fade-leave-active {
transition:
opacity 0.3s ease,
transform 0.3s ease;
}
.#{$modal-prefix}-content-fade-enter-from,
.#{$modal-prefix}-content-fade-leave-to {
opacity: 0;
transform: scale(0.95);
}
.#{$modal-prefix}-content-fade-enter-to,
.#{$modal-prefix}-content-fade-leave-from {
opacity: 1;
transform: scale(1);
}
/* 遮罩动画 - 修复版 */
.#{$modal-prefix}-mask-fade-enter-active,
.#{$modal-prefix}-mask-fade-leave-active {
transition: opacity 0.3s ease;
}
.#{$modal-prefix}-mask-fade-enter-from,
.#{$modal-prefix}-mask-fade-leave-to {
opacity: 0;
}