Configure Fluidwind

All configuration lives in your Tailwind config. Sensible defaults mean you don't need any config to get started.

defaultRange

The global viewport range for all fluid utilities.

tailwind.config.js
theme: {
  fluidwind: {
    // Global default: all fw-* classes scale across this range
    defaultRange: ['375px', '1440px'],
  },
},

ranges

Named viewport ranges usable via the /modifier syntax.

tailwind.config.js
theme: {
  fluidwind: {
    defaultRange: ['375px', '1440px'],
    ranges: {
      // Use with: fw-text-[16px-24px]/post
      post: ['600px', '1000px'],
      // Use with: fw-text-[16px-24px]/hero
      hero: ['375px', '1920px'],
    },
  },
},
example.html
<!-- No config needed for one-off ranges -->
<h1 class="fw-text-[28px-72px]/[480-1280]">
  Scales from 480px to 1280px viewport width
</h1>

remBase

The root font size used when converting between px and rem.

tailwind.config.js
// Option A: via plugin options
plugins: [require('fluidwind')({ remBase: 18 })],

// Option B: via theme
theme: {
  fluidwind: {
    remBase: 18,
  },
},

// Resolution order: plugin options → theme → default (16)

Semantic Scales

Define named values for fontSize, spacing, and more — use them as fw-text-md instead of fw-text-[16px-24px].

Semantic scales eliminate magic numbers from your markup. Define them once in your Tailwind config; every matching fw-* utility picks them up automatically. Arbitrary [min-max] values still work alongside named keys — they are never replaced.

tailwind.config.js
theme: {
  fluidwind: {
    defaultRange: ['375px', '1440px'],

    // Named font-size scale — use as fw-text-md, fw-text-xl, etc.
    fontSize: {
      sm:  ['14px', '18px'],
      md:  ['16px', '24px'],
      lg:  ['20px', '32px'],
      xl:  ['28px', '48px'],
      '2xl': ['36px', '64px'],
    },

    // Shared spacing scale — drives padding, margin, gap, and sizing utilities
    spacing: {
      xs: ['4px',  '8px'],
      sm: ['8px',  '16px'],
      md: ['16px', '32px'],
      lg: ['24px', '64px'],
    },

    // More specific scales override spacing for their utility group:
    // padding, margin, gap, sizing, borderWidth, borderRadius
  },
},
example.html
<!-- font size -->
<h1 class="fw-text-xl">Scales 28px → 48px</h1>
<p  class="fw-text-md">Scales 16px → 24px</p>

<!-- spacing via shared scale -->
<section class="fw-p-lg fw-gap-sm">
  <!-- fw-p-lg  → padding  24px → 64px -->
  <!-- fw-gap-sm → gap     8px  → 16px -->
</section>

<!-- arbitrary values still work alongside named scales -->
<p class="fw-text-[15px-22px]">One-off size</p>

tailwind-merge

First-class conflict resolution — fw-* classes correctly override standard Tailwind (and vice-versa).

Install tailwind-merge then wrap your setup with withFluidwind() from fluidwind/tailwind-merge. All 23 fw-* utilities are mapped to their corresponding tailwind-merge class groups automatically.

tw-merge.ts
import { extendTailwindMerge } from 'tailwind-merge'
import { withFluidwind } from 'fluidwind/tailwind-merge'

// Pass withFluidwind() to extendTailwindMerge — that's all it takes.
// fw-* classes now conflict with (and correctly override) standard Tailwind classes.
export const twMerge = extendTailwindMerge(withFluidwind())

// Examples:
// twMerge('p-4 fw-p-[1rem-2rem]')          → 'fw-p-[1rem-2rem]'
// twMerge('text-sm fw-text-[16px-32px]')   → 'fw-text-[16px-32px]'
// twMerge('fw-gap-[4px-16px] gap-8')       → 'gap-8'
// twMerge('fw-p-[4px-8px] fw-p-[8px-16px]') → 'fw-p-[8px-16px]'

All utilities

Every fw-* utility, its CSS property, and an example class.

Typography

Utility Example class
fw-text-[…] fw-text-[16px-32px]

Padding

Utility Example class
fw-p-[…] fw-p-[8px-48px]
fw-px-[…] fw-px-[8px-48px]
fw-py-[…] fw-py-[8px-48px]
fw-pt-[…] fw-pt-[8px-48px]
fw-pb-[…] fw-pb-[8px-48px]
fw-pl-[…] fw-pl-[8px-48px]
fw-pr-[…] fw-pr-[8px-48px]

Margin

Utility Example class
fw-m-[…] fw-m-[8px-48px]
fw-mx-[…] fw-mx-[8px-48px]
fw-my-[…] fw-my-[8px-48px]
fw-mt-[…] fw-mt-[8px-48px]
fw-mb-[…] fw-mb-[8px-48px]
fw-ml-[…] fw-ml-[8px-48px]
fw-mr-[…] fw-mr-[8px-48px]

Sizing

Utility Example class
fw-w-[…] fw-w-[200px-800px]
fw-h-[…] fw-h-[200px-800px]
fw-min-w-[…] fw-min-w-[200px-1200px]
fw-max-w-[…] fw-max-w-[200px-1200px]
fw-min-h-[…] fw-min-h-[200px-1200px]
fw-max-h-[…] fw-max-h-[200px-1200px]

Layout

Utility Example class
fw-gap-[…] fw-gap-[8px-32px]
fw-gap-x-[…] fw-gap-x-[8px-32px]
fw-gap-y-[…] fw-gap-y-[8px-32px]

Decoration

Utility Example class
fw-border-[…] fw-border-[1px-4px]
fw-rounded-[…] fw-rounded-[4px-16px]

Background

Utility Example class
fw-bg-[…] fw-bg-[#3b82f6-#22d3ee]

Browser support

Fluidwind generates standard CSS. No JavaScript runs in the browser.

Feature Chrome Firefox Safari Edge
CSS clamp() 79 75 13.1 79
color-mix() 111 113 16.2 111

Fluidwind runs entirely at build time as a Tailwind plugin, it never ships JavaScript to the browser. The only runtime requirements are the CSS features above.

99%

Browser coverage for clamp()

93%

Browser coverage for color-mix()

0 KB

JavaScript sent to the browser

Frequently asked

Does Fluidwind work with Tailwind v4?

Yes. Fluidwind is fully compatible with Tailwind v3 & v4.

Does it increase my CSS bundle size?

Barely. Each fw-* class compiles to a single CSS declaration, a clamp() expression. There are no extra stylesheets, no runtime JS, and no media queries added.

What about SSR and server components?

Fluidwind is a Tailwind plugin, so it runs entirely at build time. The output is plain CSS. There is zero runtime dependency, it works perfectly with SSR, RSC, and static sites.

Can I mix Fluidwind utilities with regular Tailwind classes?

Absolutely. Fluidwind classes use the fw- prefix and are completely additive. Use them alongside any standard Tailwind utilities without conflicts.

What units does Fluidwind accept?

Fluidwind accepts px, rem, vw, and % for numeric values, including negative values for margin. Bare numbers are treated as px. For colors, it accepts 3- and 6-digit hex codes.

Why use rem output instead of px?

Fluidwind emits rem values in the generated clamp() to respect the user's browser font size preference.

Can I use it without any configuration?

Yes. The default viewport range is 375px–1440px and remBase defaults to 16. Zero configuration required to get started.

Can I define named values instead of writing pixel ranges every time?

Yes — that's what Semantic Scales are for. Define a fontSize or spacing scale in theme.fluidwind and use named keys like fw-text-md or fw-p-lg in your markup. Arbitrary [min-max] values still work alongside named keys.