Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.08 KB

README.md

File metadata and controls

38 lines (27 loc) · 1.08 KB

tailwindcss-fluid-typography

A tailwindcss plugin generating clamp functions directly in tailwind.
website: https://lazy-sock.github.io/tailwindcss-fluid-typography/

Installation

Install it:

npm i -D @lazy_sock/tailwindcss-fluid-typography

Then add it to the tailwind config:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
  theme: {
    extend: {},
  },
  plugins: [require("@lazy_sock/tailwindcss-fluid-typography")],
};

Usage

<div class="fluid-[1_3_500_1000]">Lorem Ipsum</div>

You have to provide four parameters: the lowest font size (in rem), the highest font-size (in rem), the vw where scaling starts (in px) and the vw where scaling ends (in px). Those parameters are seperated by a underscore ( _ ).
If you don't know what those parameters are, check out this guide about scaling font-size linearly.

License

MIT