1
0
mirror of https://github.com/danbee/danbarber.me.hugo.git synced 2025-03-04 08:59:18 +00:00
danbarber.me.hugo/assets/sass/elements/_html.scss
Daniel Barber 240af563ac Tweak font size and fix font scaling in Safari
Safari does not resize the text as the viewport is resized. This hack
gets around that by forcing a repaint on every frame. This does not seem
to impact the browsers CPU usage at all.

One interesting issue is that Safari snaps the font sizes to the
nearest pixel size, so the font sizes tend to jump around a little,
rather than scaling smoothly like Firefox/Chrome.
2019-10-20 23:05:54 -04:00

25 lines
466 B
SCSS

html {
background-color: $background-color;
color: $text-color;
font-family: $body-font-family;
font-size: calc(1vmin + 13px);
font-style: normal;
font-weight: 300;
line-height: 1.4;
@media (prefers-color-scheme: dark) {
background-color: $background-color-dark;
color: $text-color-dark;
}
}
_:default:not(:root:root),
html {
animation: webkitfix 1s forwards infinite;
}
@-webkit-keyframes webkitfix {
100% {
z-index: auto;
}
}