Skip to content

Commit

Permalink
Remove line between popover and arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
atmelmicro committed Sep 13, 2024
1 parent c104d82 commit d532592
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
32 changes: 16 additions & 16 deletions src/components/Popover/Popover.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,52 +51,52 @@

// Sides
.isRootAtTop {
bottom: 100%;
bottom: calc(100% + #{theme.$arrow-gap} - #{theme.$arrow-safe-rendering-overlap});
}

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

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

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

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

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

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

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

// 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
6 changes: 4 additions & 2 deletions src/components/Popover/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ $color: var(--rui-Popover__color);
$background-color: var(--rui-Popover__background-color);
$box-shadow: var(--rui-Popover__box-shadow);

$arrow-width: 1rem;
$arrow-height: math.div($arrow-width, 2); // 1.
$arrow-safe-rendering-overlap: 1px;
$arrow-gap: 1px;
$arrow-width: calc(1rem + #{$arrow-safe-rendering-overlap * 2});
$arrow-height: calc($arrow-width / 2); // 1.
$arrow-corner-offset: 0.75rem;
2 changes: 1 addition & 1 deletion webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const TerserPlugin = require('terser-webpack-plugin');
const VisualizerPlugin = require('webpack-visualizer-plugin2');

const MAX_DEVELOPMENT_OUTPUT_SIZE = 3300000;
const MAX_PRODUCTION_OUTPUT_SIZE = 420000;
const MAX_PRODUCTION_OUTPUT_SIZE = 430000;

module.exports = (env, argv) => ({
devtool: argv.mode === 'production'
Expand Down

0 comments on commit d532592

Please sign in to comment.