Skip to content

Commit d138ec0

Browse files
committed
feat: support ios dynamic type to improve a11y
1 parent 3f16a24 commit d138ec0

4 files changed

Lines changed: 44 additions & 4 deletions

File tree

src/app/variables.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
--text-color-primary: rgb(255 255 255);
1919
--text-color-secondary: rgb(255 255 255 / 0.65);
2020
--text-color-disabled: rgb(255 255 255 / 0.4);
21-
--font-family: system-ui, -apple-system, "Helvetica Neue", "Helvetica",
22-
sans-serif;
21+
--font-family: -apple-system, "Helvetica Neue", "Helvetica", sans-serif;
2322
--text-default: 1rem/1.5rem var(--font-family);
2423
--text-large: 1.25rem/1.5rem var(--font-family);
2524
--text-medium: 0.875rem/1.313rem var(--font-family);

src/ext/action-popup/app.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ body {
2323
overscroll-behavior: none;
2424
}
2525

26+
/**
27+
* Dynamic Type
28+
* https://support.apple.com/102453
29+
* https://webkit.org/blog/3709/using-the-system-font-in-web-content/
30+
* https://developer.apple.com/library/archive/releasenotes/General/WhatsNewInSafari/Articles/Safari_7_0.html#//apple_ref/doc/uid/TP40014305-CH5-SW10
31+
* https://github.com/w3c/csswg-drafts/issues/3708
32+
*/
33+
@supports (font: -apple-system-body) {
34+
html {
35+
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
36+
font: -apple-system-title3; /* default 20px */
37+
}
38+
}
39+
2640
body {
2741
width: auto;
2842
min-width: 16rem;
@@ -36,6 +50,13 @@ body {
3650
min-height: 16rem;
3751
}
3852
}
53+
54+
/* Avoid page zoom */
55+
input,
56+
textarea,
57+
select {
58+
font-size: max(1rem, 16px);
59+
}
3960
}
4061

4162
noscript {

src/ext/extension-page/app.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,27 @@ html {
1212
height: auto;
1313
overflow: visible;
1414
}
15+
16+
/**
17+
* Dynamic Type
18+
* https://support.apple.com/102453
19+
* https://webkit.org/blog/3709/using-the-system-font-in-web-content/
20+
* https://developer.apple.com/library/archive/releasenotes/General/WhatsNewInSafari/Articles/Safari_7_0.html#//apple_ref/doc/uid/TP40014305-CH5-SW10
21+
* https://github.com/w3c/csswg-drafts/issues/3708
22+
*/
23+
@supports (font: -apple-system-body) {
24+
html {
25+
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
26+
font: -apple-system-body; /* default 17px */
27+
}
28+
}
29+
30+
/* Avoid page zoom */
31+
input,
32+
textarea,
33+
select {
34+
font-size: max(1rem, 16px);
35+
}
1536
}
1637

1738
body {

src/ext/shared/variables.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
--text-color-primary: rgb(255 255 255);
1919
--text-color-secondary: rgb(255 255 255 / 0.65);
2020
--text-color-disabled: rgb(255 255 255 / 0.4);
21-
--font-family: system-ui, -apple-system, "Helvetica Neue", "Helvetica",
22-
sans-serif;
21+
--font-family: -apple-system, "Helvetica Neue", "Helvetica", sans-serif;
2322
--text-default: 1rem/1.5rem var(--font-family);
2423
--text-large: 1.25rem/1.5rem var(--font-family);
2524
--text-medium: 0.875rem/1.313rem var(--font-family);

0 commit comments

Comments
 (0)