mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-27 10:52:09 +00:00
ef10703db7
Now that more mobile browsers support text zoom, I don't need to worry about font size as much. Moreover, iOS and Android support a zoomed mode that makes all tap targets and text larger. This mode made my site's larger text uncomfortably larger than other sites. On Android, this is the "Display size" setting; on iOS, this is the "display zoom" setting under "Display and Brightness" section. This commit switches everything back to the browser's default font sizes to better accomodate non-default zoom levels and display zoom settings.
91 lines
2.4 KiB
CSS
91 lines
2.4 KiB
CSS
/* The dark stylesheet is the only place we set custom colors besides
|
|
* border colors for inline text. Make sure the perceptual contrast
|
|
* stays within the ideal APCA ranges, not lower and preferably not
|
|
* higher either. */
|
|
@media (prefers-color-scheme: dark) {
|
|
button,
|
|
html,
|
|
input {
|
|
/* Pure white on black causes halation.
|
|
* "background" is short for a bunch of unnecessary CSS rules
|
|
* background-color is all I need.
|
|
* This is the brightest background that still achieves an APCA
|
|
* contrast of 90 Lc.*/
|
|
background-color: #191919;
|
|
/* Dimming the default text color is not the same as reducing screen
|
|
* brightness, since other colors in this stylesheet have brighter
|
|
* red and blue channels than the default text. */
|
|
color: #e6e6e6;
|
|
}
|
|
|
|
mark {
|
|
color: #000;
|
|
background-color: #eee8a7;
|
|
}
|
|
|
|
/* Only color <a> if it's a link; if href is empty, let it be. */
|
|
a:link {
|
|
color: #eee8a7;
|
|
}
|
|
|
|
a:visited {
|
|
color: #ffd3ff;
|
|
}
|
|
|
|
/* Small text needs higher contrast.
|
|
* Do not apply to "prefers-contrast: less"
|
|
* Do not apply to "prefers-contrast: more" since
|
|
* we override colors there. */
|
|
@media not (prefers-contrast) {
|
|
sup a:link:not(:active) {
|
|
color: #feb;
|
|
}
|
|
|
|
sup a:visited:not(:active) {
|
|
color: #ffe6ff;
|
|
}
|
|
}
|
|
|
|
/* For users who request less contrast, target ACPA Lc near -80 */
|
|
@media (prefers-contrast: less) {
|
|
html,
|
|
input {
|
|
background-color: #444;
|
|
}
|
|
}
|
|
|
|
/* For users who request more contrast, target ACPA Lc near -99.
|
|
* I have a monitor with terrible contrast so I use
|
|
* "prefers-contrast: more" and this amount works for me. People
|
|
* complained that the lobste.rs dark theme has too much contrast, so
|
|
* I made that my baseline and exceeded it ever so slightly.
|
|
*
|
|
* Also, this mode ensures that visited/un-visited links look very
|
|
* different under red-green and blue-yellow color blindness.
|
|
* Normally, they look very similar under blue-yellow color blindness.
|
|
*
|
|
* I sometimes use this mode when I need to set my brightness all the
|
|
* way down. */
|
|
@media (prefers-contrast: more) {
|
|
html,
|
|
input {
|
|
background-color: #0d0d0d;
|
|
color: #f3f3f3;
|
|
}
|
|
|
|
a:link {
|
|
color: #fff970;
|
|
}
|
|
a:visited {
|
|
color: #ccfdff;
|
|
}
|
|
}
|
|
|
|
/* Specified last so it overrides :visited. I chose this color because
|
|
* it's dimmer, so it's noticeable even without color vision. However,
|
|
* it still meets the experimental SAPC-APCA threshold for "spot"
|
|
* contrast. */
|
|
a:active {
|
|
color: #f83;
|
|
}
|
|
}
|