1
1
mirror of https://github.com/primer/css.git synced 2025-01-07 14:58:54 +03:00
css/modules/primer-popover/lib/popover.scss

181 lines
2.8 KiB
SCSS
Raw Normal View History

2017-10-26 23:31:29 +03:00
.Popover {
position: absolute;
z-index: 100;
}
.Popover-message {
2017-10-27 18:14:00 +03:00
position: relative;
2017-11-07 02:48:47 +03:00
width: 232px;
2017-10-27 18:14:00 +03:00
margin-right: auto;
margin-left: auto;
2017-10-26 23:31:29 +03:00
// Carets
&::before,
&::after {
position: absolute;
2017-10-27 18:14:00 +03:00
left: 50%;
2017-10-26 23:31:29 +03:00
display: inline-block;
content: "";
}
&::before {
2017-11-08 00:54:24 +03:00
top: -$spacer-3;
2017-10-27 18:14:00 +03:00
margin-left: -9px;
2017-11-03 21:12:32 +03:00
border: $spacer-2 $border-style transparent;
2017-11-07 02:48:47 +03:00
border-bottom-color: $border-black-fade;
2017-10-26 23:31:29 +03:00
}
&::after {
2017-11-06 23:48:00 +03:00
top: -14px;
2017-11-08 00:54:24 +03:00
margin-left: -$spacer-2;
2017-11-03 21:12:32 +03:00
border: 7px $border-style transparent;
2017-10-26 23:31:29 +03:00
border-bottom-color: $bg-white;
}
2017-10-27 18:14:00 +03:00
}
2017-10-26 23:31:29 +03:00
// Bottom-oriented carets
.Popover-message--bottom,
2017-11-10 02:58:17 +03:00
.Popover-message--bottom-right,
.Popover-message--bottom-left {
&::before,
&::after {
top: auto;
border-bottom-color: transparent;
}
&::before {
2017-11-07 02:48:47 +03:00
bottom: -$spacer-3;
border-top-color: $border-black-fade;
}
&::after {
2017-11-06 23:48:00 +03:00
bottom: -14px;
border-top-color: $bg-white;
}
}
// Top & Bottom: Right-oriented carets
2017-11-10 02:58:17 +03:00
.Popover-message--top-right,
.Popover-message--bottom-right {
2017-10-27 18:14:00 +03:00
right: -9px;
margin-right: 0;
&::before,
&::after {
2017-10-26 23:31:29 +03:00
left: auto;
2017-10-27 18:14:00 +03:00
margin-left: 0;
}
2017-10-26 23:31:29 +03:00
2017-10-27 18:14:00 +03:00
&::before {
right: 20px;
}
2017-10-26 23:31:29 +03:00
2017-10-27 18:14:00 +03:00
&::after {
right: 21px;
2017-10-26 23:31:29 +03:00
}
}
2017-10-27 18:14:00 +03:00
// Top & Bottom: Left-oriented carets
2017-11-10 02:58:17 +03:00
.Popover-message--top-left,
.Popover-message--bottom-left {
2017-10-27 18:14:00 +03:00
left: -9px;
margin-left: 0;
&::before,
&::after {
2017-11-07 02:48:47 +03:00
left: $spacer-4;
2017-10-27 18:14:00 +03:00
margin-left: 0;
}
&::after {
left: $spacer-4 + 1;
2017-10-27 18:14:00 +03:00
}
}
// Right- & Left-oriented carets
.Popover-message--right,
2017-11-10 02:58:17 +03:00
.Popover-message--right-top,
.Popover-message--right-bottom,
.Popover-message--left,
2017-11-10 02:58:17 +03:00
.Popover-message--left-top,
.Popover-message--left-bottom {
&::before,
&::after {
top: 50%;
left: auto;
margin-left: 0;
border-bottom-color: transparent;
}
&::before {
margin-top: -9px;
}
&::after {
2017-11-10 02:57:53 +03:00
margin-top: -$spacer-2;
}
}
// Right-oriented carets
.Popover-message--right,
2017-11-10 02:58:17 +03:00
.Popover-message--right-top,
.Popover-message--right-bottom {
&::before {
2017-11-07 02:48:47 +03:00
right: -$spacer-3;
border-left-color: $border-black-fade;
}
&::after {
2017-11-06 23:48:00 +03:00
right: -14px;
border-left-color: $bg-white;
}
}
// Left-oriented carets
.Popover-message--left,
2017-11-10 02:58:17 +03:00
.Popover-message--left-top,
.Popover-message--left-bottom {
&::before {
2017-11-07 02:48:47 +03:00
left: -$spacer-3;
border-right-color: $border-black-fade;
}
&::after {
2017-11-06 23:48:00 +03:00
left: -14px;
border-right-color: $bg-white;
}
}
// Right & Left: Top-oriented carets
2017-11-10 02:58:17 +03:00
.Popover-message--right-top,
.Popover-message--left-top {
&::before,
&::after {
2017-11-07 02:48:47 +03:00
top: $spacer-4;
}
}
// Right & Left: Bottom-oriented carets
2017-11-10 02:58:17 +03:00
.Popover-message--right-bottom,
.Popover-message--left-bottom {
&::before,
&::after {
top: auto;
}
&::before {
2017-11-07 02:48:47 +03:00
bottom: $spacer-4;
}
&::after {
bottom: 21px;
}
}
2017-11-10 02:58:17 +03:00
.Popover-message-large {
2017-11-03 00:42:51 +03:00
@include breakpoint(sm) {
2017-11-07 02:48:47 +03:00
min-width: 320px;
2017-11-03 00:42:51 +03:00
}
2017-10-27 18:14:00 +03:00
}