tomusborne / generatepress

453 stars 89 forks source link

Typography - add unit less sizing option to allow use of css functions #519

Closed eastriverstudio closed 1 year ago

eastriverstudio commented 1 year ago

I’ve recently been playing around with settings in the typography manager setting the base tags along with utility classes for each font sizing I require as I like to set everything up globally and perform the minimum local sizing in the editor for consistency.

With fluid typography in mind I had the thought it would be cool if there was a unit less option on the font sizing field that would allow us to use newer css functions such as clamp or calc.

As an example, with this I could set up all my base tags and utility classes with clamp min / max values to achieve fluid typography across the site and have utility classes I can use in the editor. With this approach I shouldn’t even have to set font sizes manually at the local editor level anymore, unless I absolutely have to override something.