Tailwind CSS Fluid Scaling Plugin

Getting Started

Installation

Installation

Get started with the Tailwind CSS Fluid Scaling Plugin by installing the package and configuring it in your project.

Step 1: Install the Package

Install the plugin using npm, yarn, pnpm, or bun:

Terminal
npm install @gladeye/tailwind-fluid-plugin

Step 2: Configure the Plugin

In your globals.css (or your main CSS file), add the plugin import and configure the theme variables:

globals.css
@import "tailwindcss";
@plugin "@gladeye/tailwind-fluid-plugin";
@theme {
/* the Figma design for the smallest screen size */
--breakpoint-design-min: 320px;
/* the Figma design for the largest screen size */
--breakpoint-design-max: 1320px;
/* the Figma design for the smallest container size */
--breakpoint-c-min: 2rem;
/* the Figma design for the largest container size */
--breakpoint-c-max: 10rem;
}

Theme Configuration

The @theme section allows you to configure the breakpoints for fluid scaling:

  • --breakpoint-design-min: The smallest viewport size (default: 320px)
  • --breakpoint-design-max: The largest viewport size (default: 1320px)
  • --breakpoint-c-min: The smallest container size (default: 2rem)
  • --breakpoint-c-max: The largest container size (default: 10rem)

Adjust these values to match your design system's breakpoints.

Optional: Custom Fluid Variables

You can define custom fluid scaling variables in your @theme section that will be automatically calculated and available throughout your application:

globals.css
@theme {
/* Define the breakpoints for your fluid variable, if omitted it will default to --breakpoint-design-min/max values */
--fluid-site-gutter-breakpoint-design-min: 320px;
--fluid-site-gutter-breakpoint-design-max: 1320px;
/* Define the values for your fluid variable */
--fluid-site-gutter-value-min: 16px;
--fluid-site-gutter-value-max: 24px;
/* Adding them to the "spacing" namespace makes "sgs" available for utility classes, e.g "ml-sgs */
--spacing-sgs: var(--fluid-site-gutter);
}

The plugin will automatically calculate the fluid scaling and create a CSS variable named --fluid-{name} that you can reference.

Naming Convention

For custom fluid variables, use the following naming convention:

  • --fluid-{name}-breakpoint-design-min: The minimum breakpoint (optional, defaults to --breakpoint-design-min)
  • --fluid-{name}-breakpoint-design-max: The maximum breakpoint (optional, defaults to --breakpoint-design-max)
  • --fluid-{name}-value-min: The minimum value (required)
  • --fluid-{name}-value-max: The maximum value (required)

The resulting fluid variable will be available as --fluid-{name}.

Next Steps

Once installed and configured, you can start using fluid scaling utilities in your project. Check out the Usage guide to learn how to use the plugin.

Visit our website

© Gladeye 2026