Skip to content

Commit e0a4c5a

Browse files
committed
Improve responsive spacing
1 parent 560e8c7 commit e0a4c5a

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/components/Aside.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
@use "../styles/tokens" as *;
99

1010
aside {
11-
@media (min-width: calc(2 * $aside-width)) {
12-
float: right;
11+
@media (min-width: $single-width) {
12+
float: inline-end;
1313
}
1414

1515
@media (min-width: $full-width) {
@@ -21,7 +21,7 @@
2121
@media (min-width: $full-width) {
2222
position: absolute;
2323
width: $aside-width;
24-
right: calc(-1 * $space-md - $aside-width);
24+
right: calc(-1 * $space-lg - $aside-width);
2525
}
2626
}
2727
</style>

src/components/Bandcamp.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ const { album, tracks = 5 } = Astro.props;
2020
$height-per-track: 32px;
2121

2222
iframe {
23-
width: $aside-width;
23+
width: 100%;
24+
max-width: 50vh;
2425
height: auto;
2526
aspect-ratio: 1;
2627
border: 0;
2728

2829
display: block;
2930
margin-block-start: $space-xs;
3031

31-
@media (min-width: calc(2 * $aside-width)) {
32+
@media (min-width: $single-width) {
3233
margin-block-start: 0;
3334
}
3435

src/layouts/BaseLayout.astro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ import '../styles/global.scss';
5252
width: 100%;
5353

5454
padding-inline: $space-md;
55+
56+
@media (min-width: $full-width) {
57+
padding-inline-end: $space-lg;
58+
}
5559
}
5660

5761
.aside {

src/styles/_tokens.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ $space-lg: 2rem;
1919

2020
$content-width: 650px;
2121
$aside-width: 300px;
22+
23+
$single-width: calc(2 * ($aside-width + $space-md));
2224
$full-width: calc($content-width + $aside-width + 3 * $space-md);
2325

2426
// Typography

0 commit comments

Comments
 (0)