Skip to content

Commit

Permalink
fixup! Remove line between popover and arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
atmelmicro committed Aug 27, 2024
1 parent 27e520b commit 65b72d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
24 changes: 12 additions & 12 deletions src/components/Popover/Popover.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,35 @@

// Arrows
.isRootAtTop > .arrow {
top: calc(100% - 1px);
top: calc(100% - #{theme.$arrow-safe-rendering-overlap + theme.$arrow-gap});
}

.isRootAtBottom > .arrow {
bottom: calc(100% - 1px);
bottom: calc(100% - #{theme.$arrow-safe-rendering-overlap + theme.$arrow-gap});
}

.isRootAtLeft > .arrow {
left: calc(100% - 1px);
left: calc(100% - #{theme.$arrow-safe-rendering-overlap + theme.$arrow-gap});
}

.isRootAtRight > .arrow {
right: calc(100% - 1px);
right: calc(100% - #{theme.$arrow-safe-rendering-overlap + theme.$arrow-gap});
}

// Side alignments: top
.isRootAtTop.isRootAtCenter {
left: 50%;
transform: translate(-50%, #{-1 * theme.$arrow-height});
transform: translate(-50%, calc(-1 * #{theme.$arrow-height}));
}

.isRootAtTop.isRootAtStart {
left: 0;
transform: translate(0, #{-1 * theme.$arrow-height});
transform: translate(0, calc(-1 * #{theme.$arrow-height}));
}

.isRootAtTop.isRootAtEnd {
right: 0;
transform: translate(0, #{-1 * theme.$arrow-height});
transform: translate(0, calc(-1 * #{theme.$arrow-height}));
}

.isRootAtTop.isRootAtCenter > .arrow {
Expand Down Expand Up @@ -148,17 +148,17 @@
// Side alignments: left
.isRootAtLeft.isRootAtCenter {
top: 50%;
transform: translate(#{-1 * theme.$arrow-height}, -50%);
transform: translate(calc(-1 * #{theme.$arrow-height}), -50%);
}

.isRootAtLeft.isRootAtStart {
top: 0;
transform: translate(#{-1 * theme.$arrow-height}, 0);
transform: translate(calc(-1 * #{theme.$arrow-height}), 0);
}

.isRootAtLeft.isRootAtEnd {
bottom: 0;
transform: translate(#{-1 * theme.$arrow-height}, 0);
transform: translate(calc(-1 * #{theme.$arrow-height}), 0);
}

.isRootAtLeft.isRootAtCenter > .arrow {
Expand Down Expand Up @@ -216,15 +216,15 @@
}

.isRootControlled.isRootAtTop {
transform: translate(0, #{-1 * theme.$arrow-height}); // 2.
transform: translate(0, calc(-1 * #{theme.$arrow-height})); // 2.
}

.isRootControlled.isRootAtBottom {
transform: translate(0, #{theme.$arrow-height}); // 2.
}

.isRootControlled.isRootAtLeft {
transform: translate(#{-1 * theme.$arrow-height}, 0); // 2.
transform: translate(calc(-1 * #{theme.$arrow-height}), 0); // 2.
}

.isRootControlled.isRootAtRight {
Expand Down
7 changes: 4 additions & 3 deletions src/components/Popover/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ $color: var(--rui-Popover__color);
$background-color: var(--rui-Popover__background-color);
$box-shadow: var(--rui-Popover__box-shadow);

// 1 rem (16px) + 2px (for insetting the arrow)
$arrow-width: 18px;
$arrow-height: math.div($arrow-width, 2); // 1.
$arrow-safe-rendering-overlap: 1px;
$arrow-gap: 1px;
$arrow-width: calc(1rem + #{$arrow-safe-rendering-overlap + $arrow-gap});
$arrow-height: calc(math.div($arrow-width, 2)); // 1.
$arrow-corner-offset: 0.75rem;

0 comments on commit 65b72d3

Please sign in to comment.