Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Typography improvements #10648

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

CatchABus
Copy link
Contributor

@CatchABus CatchABus commented Nov 8, 2024

PR Checklist

What is the current behavior?

Right now, typography is a bit inconsistent between the two platforms and MDN specs.
More specifically, line-height does not act as a height and its visual result is quite different than that of browser.

What is the new behavior?

  • Small android size defaults cleanup
  • Added support for line-height dip and percentage units and updated calculation to be closer to that of browser
  • Corrected UIButton letter-spacing calculation which used the deprecated font property to read font size
  • Corrected iOS Button formatted text default color (it's different than the button with regular text)

BREAKING CHANGES:

  • Line height will apply like a height as the name indicates while {N} has long been using it as line-spacing. This might cause strange visual changes in apps.

@CatchABus
Copy link
Contributor Author

CatchABus commented Nov 18, 2024

After a bit of consideration, I removed all changes regarding line-height.
The reason is that the css property can also accept a multiplier value which is one of the recommended usages in the web.
NativeScript css dip values are unitless, so if we suddenly treat the line-height value as dip then we have no way of setting a multiplier.
In few words, it's best to leave it as is.

EDITED: Added line-height percentage unit to make up for the lack of multiplier value.
So we can parse raw number as dip without any worries and use percentage value whenever needed.

@CatchABus CatchABus force-pushed the feat-letter-spacing-dip branch from b35dca7 to f5f140f Compare November 20, 2024 18:29
@CatchABus CatchABus force-pushed the feat-letter-spacing-dip branch from df4824a to 666f261 Compare January 25, 2025 13:29
@CatchABus CatchABus marked this pull request as ready for review January 25, 2025 18:11
@CatchABus
Copy link
Contributor Author

CatchABus commented Jan 25, 2025

All changes regarding letter-spacing unit have been removed from this PR.
We might re-visit that case in the future provided that we don't skip the em native support since it's very useful when dealing with responsive layouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant