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

Why does minimum font base size need to be smaller than maximum font base size? #54

Open
timcase opened this issue Oct 31, 2024 · 1 comment

Comments

@timcase
Copy link

timcase commented Oct 31, 2024

There is a validation, "Min font size must be less than max font size", and I'm wondering why can't the base size be the same for both min and max. For example what if base font size for both is 16px where the containers have a different type scale value for min and max, in my case 1.125 and 1.2. Essentially I want to have the min and max container have the same base font size but different typescales and I'm seeing that it isn't possible due to the validation. I'm still learning responsive typography using clamp, and I'm unsure of what I'm doing that's why I'm asking.

Why can't min and max base font size be the same?

Thanks for your effort on this it's a very useful tool, and I'm grateful.

@AleksandrHovhannisyan
Copy link
Owner

Good question! The idea is that you generally want to scale all font sizes proportionally, rather than having one outlier font size (in this case, the base step) that's static and never changes. With that said, it looks like similar tools like utopia.fyi don't enforce any constraints. So maybe I should relax it a bit and allow the min and max font sizes to be equal. I'll think about this a bit more and get back to you.


This also made me realize my validation isn't working correctly because it only errors in one direction (if you change the min font size relative to the max). If you set the max font size to be the same as the min, it doesn't error. Will look into that.

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

No branches or pull requests

2 participants