Skip to content

Commit

Permalink
add fixed ratio width to prevent jumping in results
Browse files Browse the repository at this point in the history
  • Loading branch information
stacyk committed Sep 26, 2023
1 parent 63738d3 commit 74e172e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/components/ratio/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@
@include config.between('sm-column-break', 'lg-page-break') {
gap: var(--shim) var(--gutter);
// fixed width column to prevent layout shift as the ratio number changes
grid-template:
'heading number' min-content
'intro intro' 1fr / auto 1fr;
'intro intro' 1fr / auto var(--ratio-width);
}
@include config.above('lg-page-break') {
Expand Down Expand Up @@ -134,6 +135,7 @@
align-items: start;
display: inline-flex;
grid-area: number;
justify-content: flex-end;
line-height: 0.7; // weird number alignment
}
Expand Down
1 change: 1 addition & 0 deletions src/sass/config/scale/_ui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ $swatch: 3.25rem;
$icon-size-default: 1.125em;
$icon-small: 0.65em;
$icon-medium: 1.65em;
$ratio-width: 10rem;
$range-thumb-size: 1.35rem;
$range-input: 0.85rem;

0 comments on commit 74e172e

Please sign in to comment.