feat(a11y): add dynamic font scaling - #28314
Merged
Merged
Conversation
Issue number: N/A
---------
## What is the current behavior?
The datetime button does not support dynamic type.
## What is the new behavior?
Adds support for dynamic type by converting `font-size` to use `rem`
units and adding an ellipsis to text when the size is too large.
## Does this introduce a breaking change?
- [ ] Yes
- [x] No
## Other information
Dynamic type can be enabled with the following CSS:
```css
html {
--ion-dynamic-type: var(--ion-default-dynamic-font);
}
```
Adds support for dynamic type by converting `font-size` to use `rem` units and setting a `max-size` which matches native iOS.
- Adds support for dynamic type by converting `font-size` to use `rem` units. - Updates the button width/height for icon only buttons in `md` to use `rem` units to scale the icon larger - Adds test for scaling the font which checks default buttons, clear buttons (because they use a different `font-size`), buttons with an icon, and a button containing only an icon
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> The chip component does not support dynamic type. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> The chip component supports dynamic type, has a dynamic height, has min and max font sizes in `ios` mode, and has a screenshot test. ### md mode Small md mode: <img width="1368" alt="md-small" src="https://github.com/ionic-team/ionic-framework/assets/14926794/4466c1b6-6d01-4ec8-8de9-0eb71fa45223"> Medium md mode: <img width="1371" alt="md-medium" src="https://github.com/ionic-team/ionic-framework/assets/14926794/c51c324e-a3b7-486b-9f68-84b0e4146570"> Large md mode: <img width="1369" alt="md-large" src="https://github.com/ionic-team/ionic-framework/assets/14926794/166e1229-96b7-4270-9ef2-4c708776691e"> ### ios mode Small ios mode: <img width="1371" alt="ios-small" src="https://github.com/ionic-team/ionic-framework/assets/14926794/de240058-5fe5-4387-8481-d695950853db"> Medium ios mode: <img width="1371" alt="ios-medium" src="https://github.com/ionic-team/ionic-framework/assets/14926794/c63db4be-e813-4917-a525-02ec456849ea"> Large ios mode: <img width="1370" alt="ios-large" src="https://github.com/ionic-team/ionic-framework/assets/14926794/3479f619-82c8-4645-85f7-2725ea43de00"> ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> This also fixes an existing bug that the contents of a chip could get smooshed if the chip doesn't have enough horizontal space for its contents. ### Before <img width="253" alt="rStll" src="https://github.com/ionic-team/ionic-framework/assets/14926794/9a8f4c30-ceef-4fe1-a600-38b2f01c4e68"> ### After <img width="253" alt="Screenshot 2023-08-02 at 5 00 39 PM" src="https://github.com/ionic-team/ionic-framework/assets/14926794/e82e17c3-91e3-4089-a57b-16c7d7b386fb"> --------- Co-authored-by: ionitron <hi@ionicframework.com> Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
Adds support for dynamic type by converting `font-size` to use `rem` units and setting a max `font-size` which matches native iOS.
Adds support for dynamic type by converting `font-size` to use `rem` units and setting a min `font-size` which matches native iOS.
Adds support for dynamic type by converting `font-size` to use `rem` units.
Adds support for dynamic type by converting `font-size` to use `rem` units.
Adds support for dynamic type by converting `font-size` to use `rem` units and adds a min and max `font-size` for `ios`.
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> The dynamic type feature branch screenshots are out of sync with the updated state from changes on `main`. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Regenerates update screenshot diffs for the dynamic type feature branch with the latest changes from `main` ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Co-authored-by: ionitron <hi@ionicframework.com>
chore: sync with main
Adds support for dynamic type by converting `font-size` to use `rem` units. Upgrades the `sass` version to `1.33.0` to support this change.
Adds support for dynamic type by converting `font-size` to use `rem` units and adds a min and max `font-size` for `ios`.
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> ion-textarea does not support dynamic type ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - ion-textarea does support dynamic type ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Mostly, dynamic type for textarea was already supported. Only the bottom-content had a static size. All other font sizes were all already relative. Note: Textareas do not currently look correct when they are in an item, because #27989 has not yet merged. Once that PR is merged, the font sizes within textareas will be relative to the item sizes, and both will scale appropriately. If preferred, I can base this PR off branch FW-4432 instead. --------- Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: ionitron <hi@ionicframework.com> Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
chore: sync with main
Co-authored-by: ionitron <hi@ionicframework.com>
…8209) Converts some of the `rem` units for dynamic font scaling to use the `dynamic-font` functions that didn't exist when these were implemented.
Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com> Co-authored-by: ionitron <hi@ionicframework.com>
chore: sync with feature-7.5
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> The Dynamic Font Scaling branch was using an outdated version of Ionicons which did not support Dynamic Font Scaling. There were no visual diffs because we typically override the size of the icon internally, but still good to be on the latest version. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Ionic Core uses Ionicons 7.2 internally ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
liamdebeasi
marked this pull request as ready for review
October 10, 2023 17:41
liamdebeasi
requested review from
averyrousseau,
brandyscarney,
mapsandapps and
sean-perkins
as code owners
October 10, 2023 17:41
sean-perkins
approved these changes
Oct 10, 2023
This was referenced Oct 10, 2023
|
This was a breaking change to the app I work on. Suddenly all Ionic controls got too small and tweaking the font-size in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #24638, resolves #18592
What is the current behavior?
Developers have requested that Ionic Framework support the dynamic type feature on iOS for accessibility purposes. Ionic applications do not respond to font scaling on iOS which can create inaccessible applications particularly for users with low vision. Ionic apps on Android devices currently support the Android equivalent due to functionality in the Chromium webview.
Developers have also requested a way of adjusting the fonts in their Ionic UI components consistently.
What is the new behavior?
reminstead ofpxwhere appropriate. This means devs can change the font size onhtmland the text in supported Ionic components will scale up/down appropriatelyDoes this introduce a breaking change?
Other information