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

postcss-responsive-css-values

v1.0.0

Published

This PostCSS plugin provides you with a function that allows you to use dynamic values instead of static CSS values, which are automatically reduced from a defined breakpoint.

Readme

PostCSS Responsive CSS Values

This PostCSS plugin provides you with the res-val() function, which allows you to use dynamic values instead of static CSS values that are automatically reduced from a certain breakpoint.

The function receives three values: Min, Max and a breakpoint. As long as the page width is greater than or equal to the breakpoint, it outputs the max value. As soon as the page width falls below the breakpoint, the value is scaled proportionally to the width until the Min value is reached.

The function currently only works with pixel values.

Example & Usage

In the res-val() function, the first value is always the minimum value (Min), the second value is the maximum value (Max). The third value is the breakpoint, which will be discussed below. In your CSS input file:

.heading {
    font-size: res-val(32, 60, 1200);
}

The CSS output:

.heading {
  font-size: clamp(32px, 100vw * (60 / 1200), 60px);
}

This causes the .heading class to have a font size of 60px. As soon as the page width is smaller than 1200px, the font size is reduced in relation to the page width until a size of 32px is reached.

The function can of course be used on all CSS specifications that can work with pixel values. Width, Height, Margin, Pudding etc. All values that are needed to smoothly scale a layout smaller without media queries.

Installation

To use the plugin, it can either be installed via npm or the index.js must be inserted into the development environment. If the script is inserted manually, the index.js script must be renamed to postcss-responsive-css-values.js.

PostCSS registration

In order for the plugin to be used in the PostCSS build process, it must be registered in the PostCSS config file.

export default {
    plugins: {
        "postcss-responsive-css-values": {},
    }
}

Breakpoints

The default breakpoint for the script is 769px. This default breakpoint is always used if no separate breakpoint is specified in the respective res-val() function. If a breakpoint is specified in a res-val() function, it is only used for this function.

Function without its own breakpoint

This function will use the default breakpoint

.wrapper {
    width: res-val(1000, 1600);
}

Function with its own breakpoint

.wrapper {
    width: res-val(1000, 1600, 1300);
}

Overwrite default breakpoint

You can also define the default breakpoint yourself. This must be specified in the PostCSS config as follows:

export default {
    plugins: {
        'postcss-responsive-css-values': { breakpoint: '1920' },
    }
}

In this example, the breakpoint would be set to 1920px.