Skip to content

Commit 9ae29f2

Browse files
committed
Ensure time is centered when seconds are hidden
1 parent 3b49d6a commit 9ae29f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/Clock.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ export default function Clock(props: Props) {
8686
else if (font.includes('Pacifico')) {
8787
return '6.5vw';
8888
}
89-
return '7.75vw';
89+
90+
return 'auto';
9091
}
9192

9293
const dateFontSize = isHidingClock ? '6vw' : '3vw';
@@ -102,10 +103,10 @@ export default function Clock(props: Props) {
102103
mb={getDisplayMarginBottom(fontSelection)}
103104
>
104105
{!isHidingClock &&
105-
<Box display="flex" flexDirection="row" mb={clockMarginBottom}>
106+
<Box display="flex" flexDirection="row" justifyContent='center' mb={clockMarginBottom}>
106107
{Array.from(formatTime(time)).map((digit, i) => {
107108
const width = getMonospaceCharacterWidth(digit, fontSelection);
108-
return <Text key={i} fontSize="12vw" width={width}>{digit}</Text>
109+
return <Text key={i} fontSize="12vw" sx={{fontVariantNumeric: 'tabular-nums'}} width={width}>{digit}</Text>
109110
})}
110111
</Box>
111112
}

0 commit comments

Comments
 (0)