Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support ios dynamic type to improve a11y #628

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/app/variables.css
Original file line number Diff line number Diff line change
@@ -18,8 +18,7 @@
--text-color-primary: rgb(255 255 255);
--text-color-secondary: rgb(255 255 255 / 0.65);
--text-color-disabled: rgb(255 255 255 / 0.4);
--font-family: system-ui, -apple-system, "Helvetica Neue", "Helvetica",
sans-serif;
--font-family: -apple-system, "Helvetica Neue", "Helvetica", sans-serif;
--text-default: 1rem/1.5rem var(--font-family);
--text-large: 1.25rem/1.5rem var(--font-family);
--text-medium: 0.875rem/1.313rem var(--font-family);
21 changes: 21 additions & 0 deletions src/ext/action-popup/app.css
Original file line number Diff line number Diff line change
@@ -23,6 +23,20 @@ body {
overscroll-behavior: none;
}

/**
* Dynamic Type
* https://support.apple.com/102453
* https://webkit.org/blog/3709/using-the-system-font-in-web-content/
* https://developer.apple.com/library/archive/releasenotes/General/WhatsNewInSafari/Articles/Safari_7_0.html#//apple_ref/doc/uid/TP40014305-CH5-SW10
* https://github.com/w3c/csswg-drafts/issues/3708
*/
@supports (font: -apple-system-body) {
html {
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
font: -apple-system-title3; /* default 20px */
}
}

body {
width: auto;
min-width: 16rem;
@@ -36,6 +50,13 @@ body {
min-height: 16rem;
}
}

/* Avoid page zoom */
input,
textarea,
select {
font-size: max(1rem, 16px);
}
}

noscript {
21 changes: 21 additions & 0 deletions src/ext/extension-page/app.css
Original file line number Diff line number Diff line change
@@ -12,6 +12,27 @@ html {
height: auto;
overflow: visible;
}

/**
* Dynamic Type
* https://support.apple.com/102453
* https://webkit.org/blog/3709/using-the-system-font-in-web-content/
* https://developer.apple.com/library/archive/releasenotes/General/WhatsNewInSafari/Articles/Safari_7_0.html#//apple_ref/doc/uid/TP40014305-CH5-SW10
* https://github.com/w3c/csswg-drafts/issues/3708
*/
@supports (font: -apple-system-body) {
html {
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
font: -apple-system-body; /* default 17px */
}
}

/* Avoid page zoom */
input,
textarea,
select {
font-size: max(1rem, 16px);
}
}

body {
3 changes: 1 addition & 2 deletions src/ext/shared/variables.css
Original file line number Diff line number Diff line change
@@ -18,8 +18,7 @@
--text-color-primary: rgb(255 255 255);
--text-color-secondary: rgb(255 255 255 / 0.65);
--text-color-disabled: rgb(255 255 255 / 0.4);
--font-family: system-ui, -apple-system, "Helvetica Neue", "Helvetica",
sans-serif;
--font-family: -apple-system, "Helvetica Neue", "Helvetica", sans-serif;
--text-default: 1rem/1.5rem var(--font-family);
--text-large: 1.25rem/1.5rem var(--font-family);
--text-medium: 0.875rem/1.313rem var(--font-family);
Loading