ant-design/components/modal/style/modal.less

162 lines
3.2 KiB
Plaintext
Raw Normal View History

2018-12-07 20:02:01 +08:00
@dialog-prefix-cls: ~'@{ant-prefix}-modal';
@table-prefix-cls: ~'@{ant-prefix}-table';
@modal-footer-padding-vertical: 10px;
@modal-footer-padding-horizontal: 16px;
2016-05-05 15:03:24 +08:00
.@{dialog-prefix-cls} {
.reset-component;
2016-05-05 15:03:24 +08:00
position: relative;
top: 100px;
2016-05-05 15:03:24 +08:00
width: auto;
margin: 0 auto;
2016-05-18 18:55:50 +08:00
padding-bottom: 24px;
2016-05-05 15:03:24 +08:00
&-wrap {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: @zindex-modal;
overflow: auto;
2016-05-05 15:03:24 +08:00
outline: 0;
-webkit-overflow-scrolling: touch;
2016-05-05 15:03:24 +08:00
}
&-title {
margin: 0;
color: @heading-color;
font-weight: 500;
2016-11-08 21:07:01 +08:00
font-size: @font-size-lg;
line-height: 22px;
2016-05-05 15:03:24 +08:00
}
&-content {
position: relative;
background-color: @component-background;
background-clip: padding-box;
2016-05-05 15:03:24 +08:00
border: 0;
border-radius: @border-radius-base;
2016-10-14 21:43:59 +08:00
box-shadow: @shadow-2;
2016-05-05 15:03:24 +08:00
}
&-close {
position: absolute;
2017-04-19 11:13:39 +08:00
top: 0;
right: 0;
z-index: @zindex-popup-close;
padding: 0;
color: @text-color-secondary;
2016-05-05 15:03:24 +08:00
font-weight: 700;
line-height: 1;
text-decoration: none;
background: transparent;
border: 0;
outline: 0;
cursor: pointer;
transition: color 0.3s;
2016-05-05 15:03:24 +08:00
&-x {
display: block;
width: 56px;
height: 56px;
font-size: @font-size-lg;
2016-05-05 15:03:24 +08:00
font-style: normal;
line-height: 56px;
2016-05-05 15:03:24 +08:00
text-align: center;
text-transform: none;
text-rendering: auto;
}
&:focus,
2016-05-05 15:03:24 +08:00
&:hover {
color: @icon-color-hover;
2016-05-05 15:03:24 +08:00
text-decoration: none;
}
}
&-header {
padding: 16px 24px;
2016-11-08 20:50:59 +08:00
color: @text-color;
background: @modal-header-bg;
border-bottom: @border-width-base @border-style-base @border-color-split;
border-radius: @border-radius-base @border-radius-base 0 0;
2016-05-05 15:03:24 +08:00
}
&-body {
padding: @modal-body-padding;
2016-11-08 20:57:07 +08:00
font-size: @font-size-base;
line-height: @line-height-base;
word-wrap: break-word;
2016-05-05 15:03:24 +08:00
}
&-footer {
padding: @modal-footer-padding-vertical @modal-footer-padding-horizontal;
2016-05-05 15:03:24 +08:00
text-align: right;
background: @modal-footer-bg;
border-top: @border-width-base @border-style-base @border-color-split;
2016-05-05 15:03:24 +08:00
border-radius: 0 0 @border-radius-base @border-radius-base;
button + button {
margin-bottom: 0;
margin-left: 8px;
2016-05-05 15:03:24 +08:00
}
}
&.zoom-enter,
&.zoom-appear {
transform: none; // reset scale avoid mousePosition bug
opacity: 0;
animation-duration: @animation-duration-slow;
user-select: none; // https://github.com/ant-design/ant-design/issues/11777
2016-05-05 15:03:24 +08:00
}
&-mask {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
2016-05-05 15:03:24 +08:00
z-index: @zindex-modal-mask;
height: 100%;
background-color: @modal-mask-bg;
2018-12-07 20:02:01 +08:00
filter: ~'alpha(opacity=50)';
2016-05-05 15:03:24 +08:00
&-hidden {
display: none;
}
}
2016-05-18 18:55:50 +08:00
&-open {
overflow: hidden;
}
2016-05-05 15:03:24 +08:00
}
2018-07-31 17:05:07 +08:00
.@{dialog-prefix-cls}-centered {
text-align: center;
&::before {
2018-07-31 17:05:07 +08:00
display: inline-block;
width: 0;
2018-07-31 17:05:07 +08:00
height: 100%;
vertical-align: middle;
content: '';
2018-07-31 17:05:07 +08:00
}
.@{dialog-prefix-cls} {
top: 0;
display: inline-block;
2018-07-31 17:05:07 +08:00
text-align: left;
vertical-align: middle;
2018-07-31 17:05:07 +08:00
}
}
2018-05-29 03:38:15 +08:00
@media (max-width: @screen-sm-max) {
.@{dialog-prefix-cls} {
max-width: calc(100vw - 16px);
margin: 8px auto;
}
2018-07-31 17:05:07 +08:00
.@{dialog-prefix-cls}-centered {
.@{dialog-prefix-cls} {
flex: 1;
}
}
}