Skip to content

Commit d550f55

Browse files
committed
fix
1 parent 0109093 commit d550f55

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

‎src/components/Timer.svelte‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@
137137
display: flex;
138138
flex-direction: column;
139139
gap: 1.25rem;
140+
/* Let children shrink below their min-content so the nowrap timer digits
141+
size against the card width instead of widening the layout. */
142+
min-width: 0;
143+
}
144+
.timer > :global(*) {
145+
min-width: 0;
140146
}
141147
.timer.collapsed {
142148
min-height: calc(100vh - 6.5rem);

‎src/components/TimerDisplay.svelte‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,43 @@
1818

1919
<style>
2020
.display {
21+
/* Size the digits relative to the card width (cqw), not the viewport, so
22+
card/page padding is accounted for and "00:00.000" never overflows on
23+
narrow phones. */
24+
container-type: inline-size;
2125
text-align: center;
2226
font-variant-numeric: tabular-nums;
2327
font-feature-settings: "tnum";
2428
line-height: 1;
2529
margin-bottom: 2rem;
30+
white-space: nowrap;
2631
}
2732
.major {
28-
font-size: clamp(3.5rem, 16vw, 6rem);
33+
font-size: clamp(2.5rem, 22cqw, 6rem);
2934
font-weight: 600;
3035
letter-spacing: 0.01em;
3136
}
3237
.colon,
3338
.dot {
34-
font-size: clamp(2.5rem, 11vw, 4rem);
39+
font-size: clamp(1.8rem, 15cqw, 4rem);
3540
font-weight: 300;
3641
color: var(--cds-text-secondary, #8d8d8d);
37-
margin: 0 0.05em;
42+
margin: 0 0.04em;
3843
}
3944
.ms {
40-
font-size: clamp(1.6rem, 7vw, 2.4rem);
45+
font-size: clamp(1.1rem, 9cqw, 2.4rem);
4146
font-weight: 500;
4247
color: var(--cds-interactive, #4589ff);
4348
}
4449
4550
.display.big .major {
46-
font-size: clamp(4.5rem, 24vw, 10rem);
51+
font-size: clamp(2.5rem, 24cqw, 9rem);
4752
}
4853
.display.big .colon,
4954
.display.big .dot {
50-
font-size: clamp(3rem, 16vw, 6.5rem);
55+
font-size: clamp(1.8rem, 16cqw, 6rem);
5156
}
5257
.display.big .ms {
53-
font-size: clamp(2rem, 10vw, 4rem);
58+
font-size: clamp(1.4rem, 9cqw, 3.6rem);
5459
}
5560
</style>

0 commit comments

Comments
 (0)