ant-design/style/components/popover.less

246 lines
5.1 KiB
Plaintext
Raw Normal View History

2015-06-17 16:58:13 +08:00
@import "../mixins/index";
2015-08-20 16:55:42 +08:00
@popover-prefix-cls: ~"@{css-prefix}popover";
2015-06-17 16:58:13 +08:00
//
// Popovers
// --------------------------------------------------
//== Popovers
//
//##
//** Popover body background color
@popover-bg: #fff;
//** Popover maximum width
@popover-min-width: 177px;
//** Popover border color
2016-03-04 17:06:39 +08:00
@popover-border-color: @border-color-base;
2015-06-17 16:58:13 +08:00
//** Popover arrow width
@popover-arrow-width: 4px;
2016-02-24 18:03:13 +08:00
2015-06-17 16:58:13 +08:00
//** Popover arrow color
@popover-arrow-color: @popover-bg;
//** Popover outer arrow width
@popover-arrow-outer-width: (@popover-arrow-width + 1);
//** Popover outer arrow color
@popover-arrow-outer-color: fadein(@popover-border-color, 5%);
2015-08-20 16:55:42 +08:00
.@{popover-prefix-cls} {
2015-06-17 16:58:13 +08:00
position: absolute;
top: 0;
left: 0;
z-index: 1080;
cursor: auto;
user-select: text;
white-space: normal;
font-size: @font-size-base;
line-height: @line-height-base;
font-weight: normal;
text-align: left;
&:after {
content: "";
position: absolute;
2016-03-13 15:28:56 +08:00
background: rgba(255, 255, 255, 0.01);
2015-06-17 16:58:13 +08:00
}
&-hidden {
display: none;
}
// Offset the popover to account for the popover arrow
2015-11-26 19:32:55 +08:00
&-placement-top,
&-placement-topLeft,
&-placement-topRight {
2016-02-24 18:03:13 +08:00
padding-bottom: @popover-arrow-width;
2015-06-17 16:58:13 +08:00
}
2015-11-26 19:32:55 +08:00
&-placement-right,
&-placement-rightTop,
&-placement-rightBottom {
2016-02-24 18:03:13 +08:00
padding-left: @popover-arrow-width;
2015-06-17 16:58:13 +08:00
}
2015-11-26 19:32:55 +08:00
&-placement-bottom,
&-placement-bottomLeft,
&-placement-bottomRight {
2016-02-24 18:03:13 +08:00
padding-top: @popover-arrow-width;
2015-06-17 16:58:13 +08:00
}
2015-11-26 19:32:55 +08:00
&-placement-left,
&-placement-leftTop,
&-placement-leftBottom {
2016-02-24 18:03:13 +08:00
padding-right: @popover-arrow-width;
2015-06-17 16:58:13 +08:00
}
&-inner {
min-width: @popover-min-width;
background-color: @popover-bg;
background-clip: padding-box;
border: 1px solid @popover-border-color;
border-radius: @border-radius-base;
2015-12-02 11:53:37 +08:00
box-shadow: @box-shadow-base;
2015-06-17 16:58:13 +08:00
}
&-title {
margin: 0; // reset heading margin
2015-07-16 11:50:36 +08:00
padding: 0 16px;
2015-07-16 12:10:13 +08:00
line-height: 32px;
height: 32px;
2016-03-04 17:06:39 +08:00
border-bottom: 1px solid @border-color-split;
2015-07-21 15:29:47 +08:00
color: #666;
2015-06-17 16:58:13 +08:00
}
&-content {
2015-07-16 11:50:36 +08:00
padding: 8px 16px;
2015-07-21 15:17:42 +08:00
color: @text-color;
2015-06-17 16:58:13 +08:00
}
2015-06-24 19:20:47 +08:00
&-message {
2015-07-16 11:50:36 +08:00
padding: 8px 0 16px;
font-size: 12px;
2015-10-14 13:28:37 +08:00
color: @text-color;
2016-03-10 16:22:52 +08:00
> .anticon {
2015-07-16 11:50:36 +08:00
color: @error-color;
2016-03-10 16:22:52 +08:00
line-height: 17px;
position: absolute;
}
&-title {
padding-left: 20px;
2015-06-17 16:58:13 +08:00
}
}
&-buttons {
text-align: right;
2015-06-24 19:20:47 +08:00
margin-bottom: 8px;
2015-06-17 16:58:13 +08:00
button {
2015-07-16 11:50:36 +08:00
margin-left: 8px;
2015-06-17 16:58:13 +08:00
}
}
// Arrows
// .popover-arrow is outer, .popover-arrow:after is inner
&-arrow {
&,
&:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
}
&-arrow {
border-width: @popover-arrow-outer-width;
}
&-arrow:after {
border-width: @popover-arrow-width;
content: "";
}
&-placement-top > &-arrow,
&-placement-topLeft > &-arrow,
&-placement-topRight > &-arrow {
2015-06-17 16:58:13 +08:00
border-bottom-width: 0;
border-top-color: @popover-arrow-outer-color;
2016-02-24 18:03:13 +08:00
bottom: 0;
2015-06-17 16:58:13 +08:00
&:after {
content: " ";
bottom: 1px;
margin-left: -@popover-arrow-width;
border-bottom-width: 0;
border-top-color: @popover-arrow-color;
}
}
2016-02-24 13:57:33 +08:00
&-placement-top > &-arrow {
left: 50%;
margin-left: -@popover-arrow-outer-width;
}
&-placement-topLeft > &-arrow {
2016-02-24 13:57:33 +08:00
left: 16px;
}
&-placement-topRight > &-arrow {
2016-02-24 13:57:33 +08:00
right: 16px;
}
2016-02-24 18:03:13 +08:00
&-placement-right > &-arrow,
&-placement-rightTop > &-arrow,
&-placement-rightBottom > &-arrow {
2016-02-24 18:03:13 +08:00
left: 0;
2015-06-17 16:58:13 +08:00
border-left-width: 0;
border-right-color: @popover-arrow-outer-color;
&:after {
content: " ";
left: 1px;
bottom: -@popover-arrow-width;
border-left-width: 0;
border-right-color: @popover-arrow-color;
}
}
2016-02-24 13:57:33 +08:00
&-placement-right > &-arrow {
top: 50%;
margin-top: -@popover-arrow-outer-width;
}
&-placement-rightTop > &-arrow {
2016-02-24 13:57:33 +08:00
top: 12px;
}
&-placement-rightBottom > &-arrow {
2016-02-24 13:57:33 +08:00
bottom: 12px;
}
&-placement-bottom > &-arrow,
&-placement-bottomLeft > &-arrow,
&-placement-bottomRight > &-arrow {
2015-06-17 16:58:13 +08:00
border-top-width: 0;
border-bottom-color: @popover-arrow-outer-color;
2016-02-24 18:03:13 +08:00
top: 0;
2015-06-17 16:58:13 +08:00
&:after {
content: " ";
top: 1px;
margin-left: -@popover-arrow-width;
border-top-width: 0;
border-bottom-color: @popover-arrow-color;
}
}
2016-02-24 13:57:33 +08:00
&-placement-bottom > &-arrow {
left: 50%;
margin-left: -@popover-arrow-outer-width;
}
&-placement-bottomLeft > &-arrow {
2016-02-24 13:57:33 +08:00
left: 16px;
}
&-placement-bottomRight > &-arrow {
2016-02-24 13:57:33 +08:00
right: 16px;
}
2015-06-17 16:58:13 +08:00
&-placement-left > &-arrow,
&-placement-leftTop > &-arrow,
&-placement-leftBottom > &-arrow {
2016-02-24 18:03:13 +08:00
right: 0;
2015-06-17 16:58:13 +08:00
border-right-width: 0;
border-left-color: @popover-arrow-outer-color;
&:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: @popover-arrow-color;
bottom: -@popover-arrow-width;
}
}
2016-02-24 13:57:33 +08:00
&-placement-left > &-arrow {
top: 50%;
margin-top: -@popover-arrow-outer-width;
}
&-placement-leftTop > &-arrow {
2016-02-24 13:57:33 +08:00
top: 12px;
}
&-placement-leftBottom > &-arrow {
2016-02-24 13:57:33 +08:00
bottom: 12px;
}
2015-06-17 16:58:13 +08:00
}