TailwindCSS: Fluid Type Plugin
In addition to my latest blog post (TailwindCSS: Fluid typography with CSS Clamp | David Hellmann — Digital Designer & Developer) I've created a tailwindcss-fluid-type plugin to outsource this logic and to have a cleaner config.
It does the same and I could remove the overhead from my config file. The current release is 1.2.1 and it offers the same options as tailwind default font-size options like line-height and letter-spacing.
Why should I use this plugin?
Good question as for every plugin out there. It's simple. I think fluid type is one of the things that solves a lot problems especially on mobile devices. In modern designs we often use huge font-sizes for headlines to be pithy. But on mobile devices sometimes this fonts are too big and we got strange scroll behaviors or strange word breaks. Cause we have not enough space to show the whole word.
We have two options to solve this problems. First option is to declare different font sizes for it like text-md md:text-xl and this works totally fine. But you have to do this all the time and it's a bit error-prone especially when more people work on a project. Maybe someone wrote text-md sm:text-xl and another one text-md lg:text-xl.
The second approach and in my opinion the much better one is to use fluid type here. Simply put it's just declaring a min and a max font size related to a viewport size. In between the font-size is calculated (fluid). Now you don't have to deal with font-sizes at different viewports. In addition to that we use modular scale here. More infos and a configurator is here to find: Modularscale
Any question about this topic? Let me know in the comments.
Get the plugin!
tailwindcss-fluid-type- prev article TailwindCSS: Fluid typography with CSS Clamp
- next article 2021 - Ein komisches Jahr und Conn-Syndrom
Maybe interesting…
-
#changeCGN — Minirampe gegen hässliches Köln!
- P. 2014/05/18
- C. Blogging
-
Through My Lens: Linz Hafen
- P. 2016/10/10
- C. Photography
-
Make Better Shirts, wieso schon wieder was neues???
- P. 2010/12/19
- C. Tutorials
-
TailwindCSS: Fluid Type Plugin
- P. 2021/09/19
- C. Development
-
Dribbble Pro!
- P. 2011/04/22
- C. Blogging
-
Vortex New 75 (Race 3) — Mechanical Keyboard
- P. 2019/03/05
- C. Gadgets