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

Rework fontsize, better defaults #1452

Merged
merged 4 commits into from Apr 2, 2024
Merged

Rework fontsize, better defaults #1452

merged 4 commits into from Apr 2, 2024

Conversation

MV-GH
Copy link
Collaborator

@MV-GH MV-GH commented Mar 12, 2024

Compose default in SP Jerboa default in Px Jerboa default in SP now
headlineLarge 32 16 22*
headlineMedium 28 13 16*
headlineSmall 24 9 14*
titleLarge 22 16 22
titleMedium 16 13 16
titleSmall 14 9 14
bodyLarge 16 16 16
bodyMedium 14 13 14
bodySmall 12 9 12
labelLarge 14 16 14
labelMedium 12 13 12
labelSmall 11 9 11
displayLarge 57 x x
displayMedium 45 x x
displaySmall 36 x x

I made it scale with the ratio of the bodyLarge, meaning that if you set font size to 14 bodyLarge becomes 14.
And the other styles resize at the same ratio (14/16 = 87.5% size)

Fixes #1403

I am not done yet. But I recommend checking out if you see anything standing out. I made it so that most fields stay the same.

@MV-GH MV-GH changed the title Current WIP Rework fontsize, better defaults Mar 12, 2024
fun generateTypography(baseFontSize: Int): Typography {
val customRatio = baseFontSize.toFloat() / COMPOSE_BODY_LARGE_DEFAULT
Copy link
Member

Choose a reason for hiding this comment

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

This approach does seem much simpler, thx.

@MV-GH
Copy link
Collaborator Author

MV-GH commented Mar 31, 2024

Somethings I don't get

How it looked the old way:

image

this is twice titleMedium somehow new has more weight??

but using the new system

titleMedium is bigger but (even when only 14 vs original 13)
Both have the same font weight

image

@MV-GH
Copy link
Collaborator Author

MV-GH commented Mar 31, 2024

Made it look like this

image

The documented changes are:

  • HeaderTitle
  • Tabs
  • PostAndCommunityContextHeader
  • SimpleTopBar (Indifferent to this one was 16 now is 22, kept compose default)

Everything else should be the exact same as before

Opinions?

@MV-GH MV-GH marked this pull request as ready for review March 31, 2024 20:45
@MV-GH MV-GH requested a review from dessalines March 31, 2024 20:47
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

Just tested this, and it fixed the primary issue, and sizing works much better now. Thx!

@@ -811,3 +813,35 @@ fun ActionTopBar(
},
)
}

@Composable
fun DualHeaderTitle(
Copy link
Member

Choose a reason for hiding this comment

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

Thx for extracting this.

@dessalines dessalines merged commit 26511ef into LemmyNet:main Apr 2, 2024
1 check passed
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.

Tab font size too small
2 participants