Skip to content

Commit

Permalink
fix: improve FOUT on clock
Browse files Browse the repository at this point in the history
add fallback to default fonts, better than Times New Roman :D
  • Loading branch information
husa committed Aug 12, 2024
1 parent 373a70a commit d1d25cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ const getClockStyleFromSettings = (
settings: SettingsState,
): { fontFamily: string; fontSize: string } => {
const { fontSize, fontFamily } = settings;
const fallbackFont =
"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif";
return {
fontFamily,
fontFamily: `${fontFamily}, ${fallbackFont}`,
fontSize: `${fontSize}rem`,
};
};
Expand All @@ -86,7 +88,6 @@ const App = () => {
<Clock className="app__clock" />
<Date className="app__date" />
</div>

<Dock className="app__dock" onSettingsClick={() => setSettingsOpen(!isSettingsOpen)} />
</div>
<CSSTransition
Expand Down

0 comments on commit d1d25cc

Please sign in to comment.