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

[E] Expose reader font-size adjustment variable #3773

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

dananjohnson
Copy link
Member

No description provided.

@dananjohnson
Copy link
Member Author

To test:

  1. Add to a text's custom stylesheet:
.manifold-text-section {
    --font-size-adjustment: 0.625;
}
  1. View that text in the reader and confirm that the font size is being adjusted accordingly. Change the user font size setting in the header and make sure the adjustment value continues to work.
  2. Try an invalid value for the variable (a keyword, percentage, etc) and make sure it's ignored and the default reader font sizing is used.

Copy link
Contributor

@1aurend 1aurend left a comment

Choose a reason for hiding this comment

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

@dananjohnson I tried tests you suggested, and it seems like it's working to me.

A couple of thoughts that you can take or leave:

  1. Should we set an absolute min or max on font size? Depending on the adjustment value, the user size adjustments can allow font sizes that are really unreadable:
Screenshot 2024-09-16 at 11 05 48 AM
  1. It seems like it takes a hard refresh to apply the font size adjustment. If you save a stylesheet, and then click the "view" link in admin, you don't see the adjustment without reloading the reader. Can/should we do anything about this?

@dananjohnson
Copy link
Member Author

@1aurend good idea! I'll update the CSS to clamp the --font-size-adjustment value. Re: #2, that's interesting… what part is missing when you click 'View'? Also, I wonder if it's a local dev issue only.

@1aurend
Copy link
Contributor

1aurend commented Sep 16, 2024

@1aurend good idea! I'll update the CSS to clamp the --font-size-adjustment value. Re: #2, that's interesting… what part is missing when you click 'View'? Also, I wonder if it's a local dev issue only.

When I clicked view after changing the --font-size-adjustment value in the stylesheet and saving, I didn't see the reader font size change until after a hard refresh. Is that what you mean by "what part"? Could be a local issue. Are you able to reproduce?

@dananjohnson
Copy link
Member Author

Gotcha. Yeah, that's what I assumed you meant, just wanted to clarify that that value was missing. I've seen it apply/update immediately on edge, so I think we're probably good.

@dananjohnson dananjohnson merged commit 6eaaf6e into master Sep 17, 2024
3 checks passed
@dananjohnson dananjohnson deleted the mnfld-934 branch September 17, 2024 18:45
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