Skip to content

Commit

Permalink
fix(styles): Popover update max-width and some styles (#2926)
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Schürch <[email protected]>
  • Loading branch information
imagoiq and oliverschuerch authored Apr 22, 2024
1 parent 2c03942 commit e9d5fe8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .changeset/nervous-experts-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@swisspost/design-system-styles': patch
---

Updated popover styles.
- Removed popover `min-width` and updated `max-width`.
- Simplyfied popover arrow size definition.
- Removed `:focus` selector fom `.text-auto` utility class
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
align-items: self-start;
padding: 0.5em;

// Max 2/3 of the column width
max-width: min(66vw, 60rem);
min-width: 160px;
max-width: 280px;

// Max available width on mobile, popovercontainer will handle offsets
@include post.media-breakpoint-down(rg) {
Expand All @@ -32,4 +32,5 @@

.popover-content {
padding: 0.5em;
flex-grow: 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
}

.arrow {
// Diagonal of 16px -> 1rem -> 1/1.41 = ~0.7
// https://www.omnicalculator.com/math/square-diagonal?c=CHF&v=hide:0,diagonal:16!cm
$arrow-size: math.div(spacing.$size-regular, math.sqrt(2));
$arrow-size: 0.5825rem;
position: absolute;
width: $arrow-size;
height: $arrow-size;
Expand Down
2 changes: 0 additions & 2 deletions packages/styles/src/components/utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ span.spacer {
a {
color: inherit;

&:focus,
&:hover {
opacity: 0.8;
}
Expand All @@ -83,7 +82,6 @@ span.spacer {
a {
color: var(--post-contrast-color);

&:focus,
&:hover {
color: rgba(var(--post-contrast-color-rgb), 0.8);
}
Expand Down

0 comments on commit e9d5fe8

Please sign in to comment.