Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tailwind-fluid-typography

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwind-fluid-typography

Fluid typography plugin for the tailwindcss framework

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
170
decreased by-36.57%
Maintainers
1
Weekly downloads
 
Created
Source
Tailwind Fluid Typography

Tailwind Fluid Typography

Based on the fluid typography theory devised by Mike Riethmuller and incorporating ideas from Google's Material Design spec, Tailwind Fluid Typography gives you a new set of utility classes that scale modularly depending on screen size.

  • Set breakpoints for when your type should start and stop scaling
  • Dual scaling system gives you the ability to set your desired scale for your lower breakpoint and for your higher breakpoint
  • Provides base, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl, 7xl, 8xl and 9xl font-sizes

Installation

npm i tailwind-fluid-typography
// or
yarn add tailwind-fluid-typography
// tailwind.config.js
module.exports = {
    theme: {
        fluidTypography: {}
    },
    plugins: [
        require('tailwind-fluid-typography')
    ]
}

Usage

<h1 class="fluid-4xl">Fluid Typography @ 4XL</h1>
<h2 class="fluid-3xl">Fluid Typography @ 3XL</h2>
<h3 class="fluid-2xl">Fluid Typography @ 2XL</h3>
<h4 class="fluid-xl">Fluid Typography @ XL</h4>
<h5 class="fluid-lg">Fluid Typography @ LG</h5>
<h6 class="md:fluid-lg">Fluid Typography @ LG</h6>
<p class="fluid-base">Fluid Typography</p>

Customisation

To customise the plugin settings, you can pass the following properties as part of a fluidTypography property on theme:

NameTypeDefaultDescription
remSizeNumber16The px size to assume for 1rem
minScreenSizeNumber320The screen size (in px) at which to begin scaling
maxScreenSizeNumber1920The screen size (in px) at which to stop scaling
minTypeScaleNumber1.2The scaling factor to use at minScreenSize
maxTypeScaleNumber1.333The scaling factor to use at maxScreenSize
lineHeightNumber1.35The line-height to use for heading classes

For example:

theme: {
    fluidTypography: {
        remSize: 14,
        minScreenSize: 600,
        maxScreenSize: 1280,
        minTypeScale: 1.250,
        maxTypeScale: 1.618,
        lineHeight: 1.5
    }
}

Suggested type scales

Minor Second1.067
Major Second1.125
Minor Third1.200default minTypeScale
Major Third1.250
Perfect Fourth1.333default maxTypeScale
Augmented Fourth1.414
Perfect Fifth1.500
Golden Ratio1.618

Keywords

FAQs

Package last updated on 06 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc