naive-ui/styles/Alert.scss

97 lines
2.7 KiB
SCSS
Raw Normal View History

@import './mixins/mixins.scss';
2020-02-11 14:44:29 +08:00
2019-10-12 14:23:40 +08:00
@mixin alert-type-mixin ($type) {
@include m($type + '-type') {
background-color: map-get($--alert-background-color, $type);
box-shadow: inset 0 0 0 1.2px map-get($--alert-border-color, $type);
2019-11-21 23:50:53 +08:00
text-align: left;
2019-10-12 14:23:40 +08:00
@include e(icon) {
@include b(icon) {
2019-12-09 19:16:03 +08:00
fill: map-get($--alert-icon-color, $type);
2020-02-07 20:04:20 +08:00
stroke: map-get($--alert-icon-color, $type);
2019-10-12 14:23:40 +08:00
}
2019-07-02 14:48:49 +08:00
}
2019-10-12 14:23:40 +08:00
@include b(alert-body) {
@include e(title) {
color: map-get($--alert-title-text-color, $type);
}
@include e(content) {
color: map-get($--alert-content-text-color, $type);
}
}
}
2019-10-12 14:23:40 +08:00
}
@include themes-mixin {
@include b(alert) {
@include once {
2020-02-11 17:19:00 +08:00
@include fade-in-height-expand-transition($original-transition: (transform .3s $--n-ease-in-out-cubic-bezier));
&.#{block(fade-in-height-expand-transition)}-leave, &.#{block(fade-in-height-expand-transition)}-enter-to {
2019-12-09 19:16:03 +08:00
transform: scale(1);
}
2020-02-11 17:19:00 +08:00
&.#{block(fade-in-height-expand-transition)}-leave-to, &.#{block(fade-in-height-expand-transition)}-enter {
2019-12-09 19:16:03 +08:00
transform: scale(.9);
}
2019-10-12 14:23:40 +08:00
border-radius: 6px;
position: relative;
transition: background-color .3s $--n-ease-in-out-cubic-bezier, box-shadow .3s $--n-ease-in-out-cubic-bezier;
2019-10-12 14:23:40 +08:00
@include e(icon) {
position: absolute;
2019-12-09 19:16:03 +08:00
left: 12px;
top: 14px;
2019-10-12 14:23:40 +08:00
align-items: center;
justify-content: center;
width: 19px;
height: 19px;
@include b(icon) {
2019-12-09 19:16:03 +08:00
font-size: 26px;
}
}
@include e(close) {
position: absolute;
right: 16px;
top: 14px;
width: 19px;
height: 19px;
@include b(icon) {
cursor: pointer;
font-size: 19px;
2019-10-12 14:23:40 +08:00
}
}
@include b(alert-body) {
2019-12-09 19:16:03 +08:00
padding: 16px 16px 16px 48px;
2019-10-12 14:23:40 +08:00
@include e(title) {
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-10-12 14:23:40 +08:00
font-size: 16px;
line-height: 19px;
2019-12-23 16:48:49 +08:00
font-weight: 500;
2019-11-22 12:06:11 +08:00
& + {
@include e(content) {
margin-top: 9px;
}
}
2019-10-12 14:23:40 +08:00
}
@include e(content) {
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-10-12 14:23:40 +08:00
font-size: 14px;
}
}
@include m(no-icon) {
@include b(alert-body) {
padding-left: 19px;
}
}
}
2019-12-09 19:16:03 +08:00
@include e(close) {
@include b(icon) {
fill: $--alert-color-fill;
2020-02-07 20:04:20 +08:00
stroke: $--alert-color-fill;
2019-12-09 19:16:03 +08:00
}
}
2019-10-12 14:23:40 +08:00
@include alert-type-mixin('default');
@include alert-type-mixin('success');
@include alert-type-mixin('info');
@include alert-type-mixin('error');
@include alert-type-mixin('warning');
}
}