Skip to content

feat: global font size adjustment #24638

Description

@averyrousseau

Prerequisites

Describe the Feature Request

Currently, there isn't a way to increase or decrease the font size by the same amount across the whole project. You can adjust the sizes on individual components, but this is annoying since you have to manually set the size for every component type used.

Describe the Use Case

My particular use case is a font that's just naturally small and hard to read at the default size (Teko), so I'd like to bump the font size across the whole app up by 5px or so. This feature also has accessibility applications, though -- you could add a size option to an app without causing non-typographic elements to scale as well.

Describe Preferred Solution

I can think of a few possible fixes:

  1. New CSS variables for small/med/large font sizes that everything either uses directly, or is set relative to via calc adjustments. Googling around, it seems like there used to be SCSS variables like this in Ionic 4, but they've been removed.
  2. One new CSS variable, something like --font-size-adjustment, that gets added to all sizes. This could be automated with a mixin, similar to padding handling RTL.
  3. Update all font sizes to use em or rem units, so a global base size could be set on the root.

Describe Alternatives

As far as I can tell, the only alternatives are to either pick a different font, or manually update the font size for all components.

Related Code

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions