Skip to content

refactor: add dynamic type sass functions - #27934

Merged
liamdebeasi merged 19 commits into
FW-4146from
dynamic-type-functions
Aug 8, 2023
Merged

refactor: add dynamic type sass functions#27934
liamdebeasi merged 19 commits into
FW-4146from
dynamic-type-functions

Conversation

@liamdebeasi

@liamdebeasi liamdebeasi commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

Issue number: N/A


What is the current behavior?

One of the concerns about our dynamic type implementation is that the resulting rem values seem arbitrary. While we currently know this is the result of dividing the px font value by 16, we may not remember this in a few months.

The team would like to evaluate ways to make the font sizes more obvious in terms of how the resulting values are derived.

What is the new behavior?

  • Introduces sass functions that compute dynamic type values.
  • The base font size is specified in pixels and scales can be optionally provided too using the correct function. These scales are written as decimals rather that explicit font values. The benefit of this is if the base font size changes, so do the resulting max/min values.

Open to naming ideas, though I opted to use min/max to describe the clamp operation you are trying to do. For example, dynamic-font-min means you are generating a dynamic font with a minimum font size. This is different than what CSS does where the max() function allows you to set a minimum font size. While this deviates from what CSS does, I think this is a bit easier to understand.

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 4, 2023
@liamdebeasi liamdebeasi changed the title Dynamic type functions refactor: add dynamic type sass functions Aug 4, 2023
@liamdebeasi
liamdebeasi marked this pull request as ready for review August 4, 2023 20:30
@liamdebeasi
liamdebeasi merged commit 7b458b6 into FW-4146 Aug 8, 2023
@liamdebeasi
liamdebeasi deleted the dynamic-type-functions branch August 8, 2023 15:05
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