npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cssints/fluid

v0.36.0

Published

fluid() for cssints: clamp() between two widths, computed at build time, with the WCAG 1.4.4 zoom check

Readme

@cssints/fluid

Fluid lengths for cssints: fluid(min, max) is a length that is min on a narrow viewport, max on a wide one, and grows linearly between. The clamp() is computed at build time, and a range that breaks text resizing (WCAG 1.4.4) fails the build. Two value members of cssints/plugin scope() (fn({ args, value }), positional arguments and an options object). No runtime.

import { fontSize, padding } from "cssints" with { type: "cssints" };
import { fluid } from "@cssints/fluid" with { type: "cssints" };

// fluid(min, max, { from?, to?, zoom? }): from and to are the widths, 20rem and 80rem when left out
export const title = fontSize(fluid("1rem", "1.5rem"));
export const lead = fontSize(fluid("16px", "24px", { from: "40rem", to: "90rem" }));
// against the inline size of the nearest container instead of the viewport
export const card = padding(fluid.container("1rem", "2rem", { to: "60rem" }));

export const hero = fontSize(fluid("1rem", "4rem")); // build error: fails WCAG 1.4.4
._bkcdcr {
  font-size: clamp(1rem, 0.8333vw + 0.8333rem, 1.5rem);
}
._1wkr2lu {
  font-size: clamp(16px, 1vw + 0.6rem, 24px);
}
._ekb8uj {
  padding: clamp(1rem, 2.5cqi + 0.5rem, 2rem);
}

Rules

  • The math. The slope is (max - min) / (to - from) and the intercept min - slope × from, written clamp(min, <slope × 100>vw + <intercept>rem, max), rounded to 4 decimals. The intercept is in rem, so the value follows the user's font size. A max below min makes a value that shrinks: the bounds are sorted for clamp() and the slope is negative.
  • Units. min, max, from and to are px or rem, at 16px to the rem; the bounds keep the unit you wrote. Other units (em, vw, %, calc(), tokens) cannot be computed at build time: the build rejects them (the types check a non-negative <length>, and a grammar cannot name units).
  • WCAG 1.4.4. The check of fluid-tailwind: at 500% zoom the viewport is a fifth as wide and the rem five times larger, and the value must still reach twice its size at 100%, or text cannot be resized to 200%. It is checked at every width (at the four kinks of the two curves), and a failure is a build error at the call that names the width: cssints: fluid: 1rem to 4rem between 20rem and 80rem fails WCAG 1.4.4: at 80rem wide, 500% zoom gives 5rem, under twice 4rem; narrow the range of sizes or widen the widths. A ratio of max to min up to about 2.5 passes with the default widths.
  • A length. The result is a Typed OM length (CSSStyleValue<"length">): it goes where a length goes, in the types, and color(fluid(...)) is an error. It can be an argument of clamp(), min() and max() of cssints.
  • Build errors (at the call): a unit that is not px or rem, min equal to max, from not below to, a failed 1.4.4 check, and the grammar of the arguments, by position (fluid.container(2): unexpected "red" in "red", expected <length>).

Limits

  • The 1.4.4 check runs on every call unless { zoom: false } is passed, which is for lengths that are not text (a padding, a gap): padding(fluid("1rem", "4rem", { zoom: false })).
  • fluid.container() uses the same check with the container's width in place of the viewport's, which holds when the container scales with the viewport.
  • No defaults from a token set, and no token as an argument: a token is a var(), which the build cannot compute with.
cd packages/fluid && bun run test   # fixtures through the engine (output, errors), and the type test via bun run typecheck

Credits

The WCAG 1.4.4 check follows fluid-tailwind (MIT, Maxwell Barvian). The check is written here; no code is copied.