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

fix: Responsive type sizes #4099

Merged
merged 1 commit into from
Dec 20, 2024
Merged

fix: Responsive type sizes #4099

merged 1 commit into from
Dec 20, 2024

Conversation

ianjon3s
Copy link
Contributor

@ianjon3s ianjon3s commented Dec 20, 2024

What does this PR do?

MUI responsive type sizes provides a one-value (factor: x) scale for resizing type which aims to provide a global function, but removes the ability to scale or fine-tune by a particular type property.

In PlanX we use h2 sizes for most page/question titles and h1 for headline/banners, MUI was resizing these to be too small comparatively to be effective.

I've tried a number of methods to work with MUI's automatic scale, ideally we'd use an up-to-date method (such as fontSize: "clamp(2.125rem, 3rem, 5rem)",, but MUI needs to see a hardcoded value for each property.

This PR introduces manual media queries to increase larger header sizes at the smallest (sub 500px wide) screens. There is also the reluctant use of an !important rule as MUI trumps any media queries defined in the theme with its own, and there is an apparent bug in h4 resizes in which MUI does not scale this correctly between 500px – 768px.

Before changes, largest viewport (left) vs smallest viewport (right):
image

After changes, largest viewport (left) vs smallest viewport (right):
image

@ianjon3s ianjon3s marked this pull request as ready for review December 20, 2024 11:29
@ianjon3s ianjon3s requested a review from a team December 20, 2024 11:30
@DafyddLlyr
Copy link
Contributor

Nice catch thanks!

Copy link

github-actions bot commented Dec 20, 2024

Removed vultr server and associated DNS entries

@ianjon3s ianjon3s merged commit 40a036c into main Dec 20, 2024
12 checks passed
@ianjon3s ianjon3s deleted the ian/responsive-type-sizes branch December 20, 2024 12:58
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.

2 participants