Skip to content

feat(item): support dynamic type - #27989

Merged
brandyscarney merged 20 commits into
FW-4146from
FW-4432
Sep 6, 2023
Merged

brandyscarney merged 20 commits into
FW-4146from
FW-4432

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Aug 14, 2023 •

Copy link
Copy Markdown
Member

Issue number: N/A


What is the current behavior?

Items do not support dynamic type.

What is the new behavior?

  • Adds support for dynamic type by converting font-size to use rem units
  • Converts icon font sizes to em units based on their parent element font size
  • Adds test for scaling the font which checks an item with only a label, an item with slotted icons, an item with a detail icon, an item with a counter, an item with helper/error text, and an item with buttons at 310%
    • I considered adding a test for an item with headings, but this is covered by the label PR so unless we remove the label from an item one day we don't need the tests in item

I also made changes to item-divider in this PR because it used a shared variable with item to set the slotted icon font-size.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@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 Aug 14, 2023
@brandyscarney
brandyscarney marked this pull request as ready for review August 14, 2023 20:29
@brandyscarney
brandyscarney requested review from a team and thetaPC and removed request for a team August 14, 2023 20:29
Base automatically changed from FW-4433 to FW-4146 August 17, 2023 14:51
@mapsandapps mapsandapps mentioned this pull request Aug 28, 2023
1 of 2 tasks
mapsandapps added a commit that referenced this pull request Aug 29, 2023
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 <[email protected]>
@brandyscarney
brandyscarney changed the base branch from FW-4146 to main September 1, 2023 16:37
@brandyscarney
brandyscarney changed the base branch from main to FW-4146 September 1, 2023 16:37

@brandyscarney brandyscarney Sep 1, 2023 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The diffs on all of these item-sliding-scale tests is expected, the item label increase causes the item to be taller which also makes the item options taller.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The diffs on all of these reorder-group-scale tests is expected, the reorder group is using an item and now the label also scales with the reorder icons.

@brandyscarney

Copy link
Copy Markdown
Member Author

I have addressed all feedback & made updates. Screenshots have been updated. I added comments explaining why there are diffs in the 2 tests I did not change. This is ready for another review.

@mapsandapps
mapsandapps removed their request for review September 5, 2023 14:14

@thetaPC thetaPC 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.

LGTM

@brandyscarney
brandyscarney merged commit 464198c into FW-4146 Sep 6, 2023
@brandyscarney
brandyscarney deleted the FW-4432 branch September 6, 2023 14:42
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.

4 participants