Skip to content

Commit f7953fe

Browse files
authored
refactor: don't declare font-size in px (#345)
* refactor: don't declare font-size in px improve accessibility by using (r)em units: https://developer.mozilla.org/en-US/docs/Web/CSS/font-size#pixels https://fedmentor.dev/posts/font-size-px/ * style(css): use 1.1rem for readability
1 parent 7ee667f commit f7953fe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

exampleSite/content/posts/theme-documentation-basics.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,11 @@ Favicons can be generated using services such as [favicon.io](https://favicon.io
296296

297297
Set the content [`font-size`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
298298

299+
Note that '[defining font sizes in px is not accessible](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size#pixels)'.
300+
299301
```toml
300302
[params]
301-
fontSize = "17.5px"
303+
fontSize = "1.1rem" # equal to 17.6px
302304
```
303305

304306
### Footer

layouts/partials/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<style>
66
:root {
77
--accent-color: {{ .Site.Params.AccentColor | default "#FF4D4D" }};
8-
--font-size: {{ .Site.Params.FontSize | default "17.5px" }};
8+
--font-size: {{ .Site.Params.FontSize | default "1.1rem" }};
99
}
1010
</style>
1111

0 commit comments

Comments
 (0)