Skip to content

feat(menu-button): support dynamic type - #28008

Merged
brandyscarney merged 6 commits into
FW-4146from
FW-4436
Aug 17, 2023
Merged

feat(menu-button): support dynamic type#28008
brandyscarney merged 6 commits into
FW-4146from
FW-4436

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Aug 16, 2023

Copy link
Copy Markdown
Member

Issue number: N/A


What is the current behavior?

Menu buttons do not support dynamic type.

What is the new behavior?

  • Adds support for dynamic type by converting font-size to use rem units
  • Adds test for scaling the font which checks the menu button at 310%

Does this introduce a breaking change?

  • Yes
  • No

Other information

I looked into how this should behave on iOS and here's what I found:

  • This is not a standard paradigm in iOS. Native iOS apps typically use lists & tabs for navigation. I checked the following native apps and they do not have a menu button:
    • App Store, Books, Calendar, Contacts, Files, Fitness, Freeform, Mail, Maps, Messages, Music, Notes, Phone, Podcasts, Reminders, Safari, Settings
  • The only two apps I found with menu buttons were Discord and Lyft
    • Both of these apps do not scale the menu button at all. Discord is built with React Native and Lyft is built with Swift.
  • I recreated it in a native Swift app by placing a button in a toolbar with a hamburger icon and got the following. I used this in order to set the min and max font-size in ios.
SwiftUI Code
import SwiftUI

struct HomeView: View {
  var body: some View {
    NavigationView {
      VStack{
        Spacer()
        Text("Home View")
        Spacer()
      }
      .toolbar {
        Button {
        } label: {
          HStack {
            Image(systemName: "line.3.horizontal")
          }
        }
        .buttonStyle(.borderless)
      }
      .padding(.horizontal, 24)
    }
  }
}
80% 100% 310%
ios native 80% ios native 100% ios native 310%

@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 16, 2023
@brandyscarney
brandyscarney changed the base branch from main to FW-4146 August 16, 2023 20:21
@brandyscarney
brandyscarney marked this pull request as ready for review August 17, 2023 14:42
@brandyscarney
brandyscarney requested review from a team and thetaPC and removed request for a team August 17, 2023 14:43

@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 5a72eca into FW-4146 Aug 17, 2023
@brandyscarney
brandyscarney deleted the FW-4436 branch August 17, 2023 17:42
sean-perkins pushed a commit that referenced this pull request Aug 18, 2023
Adds support for dynamic type by converting `font-size` to use `rem` units and adds a min and max `font-size` for `ios`.
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