formaat-design / reshaped

Community repository for storing examples, reporting issues and tracking roadmap
https://reshaped.so
97 stars 3 forks source link

Code library: Fluid typography #196

Closed ferocchi closed 2 weeks ago

ferocchi commented 8 months ago

Is your feature request related to a problem? Please describe. A site cannot be fully accessible if it is based on pixels, as you are ignoring the user's preferences to update their browser font size settings. Furthermore, working in pixels does not make the UX fluid: the elements will scale only at certain breakpoints, creating awkward design scenarios on certain devices.

Describe the solution you'd like Having the ability to set the html font size when creating a new theme, and then setting body to 1 rem by default. The snippet will look like something like this html { font-size: calc(0.625rem + 0.41666666666666663vw); } @media screen and (max-width:1920px) { html { font-size: calc(0.625rem + 0.41666666666666674vw); } } @media screen and (max-width:1440px) { html { font-size: calc(0.8126951092611863rem + 0.20811654526534862vw); } } @media screen and (max-width:479px) { html { font-size: calc(0.7494769874476988rem + 0.8368200836820083vw); } } Please see here for more details https://finsweet.com/client-first/docs/fluid-responsive The benefits are multiple (please see video below and link above):

Describe alternatives you've considered This video goes at length on why this solution makes a lot of sense https://finsweet.com/client-first/wizardry-comparison

blvdmitry commented 2 weeks ago

This is finally happening in v3 🚀

https://x.com/blvdmitry/status/1802807116153172069