Skip to content

feat(reorder): support dynamic type - #27838

Merged
liamdebeasi merged 3 commits into
FW-4146from
FW-4439
Jul 25, 2023
Merged

liamdebeasi merged 3 commits into
FW-4146from
FW-4439

Conversation

@liamdebeasi

@liamdebeasi liamdebeasi commented Jul 20, 2023 •

Copy link
Copy Markdown
Contributor

Issue number: N/A


What is the current behavior?

Reorder does not support dynamic type

What is the new behavior?

  • Convert fonts to rem
  • Also added logic so that slotted icons can participate in Dynamic Type

Does this introduce a breaking change?

  • Yes
  • No

Other information

Note that our reorder icons are bigger than the native iOS reorder icons. As a result, when scaling up to large sizes the reorder icon may look particularly large when compared with native.

Screenshot 2023-07-20 at 3 50 19 PM

The native reorder icons also seem to use a different scale than what we have access to. For example, I could match the largest font size using ~1.3rem, but at 85% text scaling the icon was way too small.

The native reorder has neither a min nor a max font size from what I could tell. Not sure what the right call is on this. At the max font size, the reorder takes up quite a bit of space such that the text in items is truncated. However, the text probably should not be truncated in the first place.

Demo: https://github.com/ionic-team/ionic-framework/assets/2721089/b473d3ca-89ea-4010-a9cb-898b86ae7f03

@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 20, 2023
display: block;
}

font-size: 22px;

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.

Each mode stylesheet overrides this, so this code never did anything

* icons resize with Dynamic Type.
*/
::slotted(ion-icon) {
font-size: 1rem;

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.

Slotted icons currently inherit a font size of 16px

@liamdebeasi liamdebeasi changed the title Fw 4439 feat(reorder): support dynamic type Jul 20, 2023
@liamdebeasi
liamdebeasi requested review from a team and mapsandapps and removed request for a team July 20, 2023 20:32
@liamdebeasi
liamdebeasi marked this pull request as ready for review July 20, 2023 20:32

@mapsandapps mapsandapps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks good, but I do have a question:

If the user passes in text to the slot, e.g.

<ion-reorder slot="end">drag me</ion-reorder>

it's not using rem. I didn't see this functionality (putting text in the reorder instead of an icon) in the docs, so I'm guessing it's not actually supported, but it might be something to consider?

@liamdebeasi

liamdebeasi commented Jul 25, 2023 •

Copy link
Copy Markdown
Contributor Author

Good catch! So when you pass text in ion-reorder is going to inherit the font size from ion-item which does not support Dynamic Type yet. So once we add support in ion-item, this should work as expected.

@liamdebeasi
liamdebeasi requested a review from mapsandapps July 25, 2023 17:09

@mapsandapps mapsandapps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good 👍🏻

@liamdebeasi
liamdebeasi merged commit 4ee14c4 into FW-4146 Jul 25, 2023
@liamdebeasi
liamdebeasi deleted the FW-4439 branch July 25, 2023 17:12
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