Skip to content

feat(action-sheet): support dynamic type - #27747

Merged
liamdebeasi merged 16 commits into
FW-4146from
FW-4418
Jul 10, 2023
Merged

feat(action-sheet): support dynamic type#27747
liamdebeasi merged 16 commits into
FW-4146from
FW-4418

Conversation

@liamdebeasi

@liamdebeasi liamdebeasi commented Jul 5, 2023

Copy link
Copy Markdown
Contributor

Issue number: N/A


What is the current behavior?

Action Sheet does not support Dynamic Type on iOS

What is the new behavior?

  • Convert iOS font sizes to rem and added a max function to ensure that text does not go smaller than the set values
  • Convert MD font sizes to rem
  • Update buttons to use min-height instead of height. I also needed to change contain from strict to content because strict caused the button to ignore children when setting the dimensions.
  • Added max-height: 10dvh so the container does not get clipped by the URL toolbar in Safari. This has technically always been an issue, but it is more easily visible now that the container can grow in size. 100vh is calculated assuming the iOS toolbar is collapsed, which is not always correct. dvh (The "d" stands for "Dynamic") changes based on if the toolbar is collapsed or not.
100vh 100dvh
IMG_0006 IMG_0007

Does this introduce a breaking change?

  • Yes
  • No

Other information

The min font size for iOS was not in the original design doc as I missed this initially. I updated the design doc to account for this: https://github.com/ionic-team/ionic-framework-design-documents/pull/114

Demo Video: https://github.com/ionic-team/ionic-framework/assets/2721089/d08c8a81-c11f-4a1d-8635-09f7f91a849a

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions Bot added the package: core @ionic/core package label Jul 5, 2023
@liamdebeasi liamdebeasi changed the title Fw 4418 feat(action-sheet): support Dynamic TYpe Jul 5, 2023
@liamdebeasi liamdebeasi changed the title feat(action-sheet): support Dynamic TYpe feat(action-sheet): support Dynamic Type Jul 5, 2023

/// @prop - Padding of the action sheet button
$action-sheet-ios-button-padding: 18px !default;
$action-sheet-ios-button-padding: 14px !default;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we are using min-height instead of height, the default height was being set to 64px due to this padding. Our old height: 56px masked the problem. You can see it in the following screenshot where the icon extends beyond the boundary of the button height (excluding the padding)
IMG_0008


/// @prop - Padding top of the action sheet button
$action-sheet-md-button-padding-top: 0 !default;
$action-sheet-md-button-padding-top: 12px !default;

@liamdebeasi liamdebeasi Jul 5, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added padding here because the buttons looked too cramped when the text scales up. This should have no impact on buttons at the default text scale

without padding with padding
IMG_0012 IMG_0011

@liamdebeasi liamdebeasi changed the title feat(action-sheet): support Dynamic Type feat(action-sheet): support dynamic type Jul 5, 2023
@liamdebeasi
liamdebeasi marked this pull request as ready for review July 5, 2023 18:47
@liamdebeasi
liamdebeasi requested review from a team, brandyscarney and mapsandapps and removed request for a team July 5, 2023 18:47
Base automatically changed from FW-4513 to FW-4146 July 6, 2023 19:17

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@liamdebeasi
liamdebeasi requested review from a team and removed request for mapsandapps July 7, 2023 17:00
@liamdebeasi
liamdebeasi merged commit 563fda7 into FW-4146 Jul 10, 2023
@liamdebeasi
liamdebeasi deleted the FW-4418 branch July 10, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants