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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tailwindcss-px-to-rem

v0.0.1

Published

A Tailwind CSS plugin automatically converts all REM units to PX units in your Tailwind styles.

Readme

TailwindCSS PX to REM Plugin This TailwindCSS plugin automatically converts pixel (px) values to rem units in your Tailwind styles. It provides a seamless way to use pixel-based values in your utility classes while maintaining consistency with Tailwind’s default rem-based system.

Why Use This Plugin? TailwindCSS generally uses rem for spacing utilities like h-10, which resolves to 2.5rem. However, in some cases, you may know the pixel value you need (e.g., h-40px) and want to work with it directly. This plugin makes it easier to use pixel values (like h-40px) while automatically converting them to rem for consistency with Tailwind's default unit system.

Use case: You know the pixel value you need, and instead of manually converting it to rem, you can use the px suffix (e.g., h-40px), and the plugin will handle the conversion. Benefit: Ensures consistent use of rem units in your layout while allowing flexibility to use pixel values where necessary. Installation Install the Plugin: bash 코드 복사 pnpm install tailwindcss-px-to-rem Configure TailwindCSS to Use the Plugin: In your tailwind.config.js, include the plugin:

js 코드 복사 const plugin = require('tailwindcss-px-to-rem');

module.exports = { plugins: [ plugin, ], }; Usage With this plugin, you can define utility classes using pixel values, and they will automatically be converted to rem units.

Example: html 코드 복사

How It Works The plugin listens for utility classes with a px suffix (e.g., h-40px) and automatically converts the pixel value to rem. This conversion ensures that your Tailwind setup remains consistent, using rem for spacing and other layout properties.

Example Plugin Code: ts 코드 복사 import plugin from 'tailwindcss/plugin';

export default plugin(function({ addUtilities, theme }) { const newUtilities = { '.h-10': { height: theme('spacing.10'), // 2.5rem }, '.h-40px': { height: '2.5rem', // 40px converted to rem }, };

addUtilities(newUtilities); }); Supported Classes Height: h-10, h-20px, h-40px, etc. Width: w-10, w-20px, w-40px, etc. You can extend this plugin to support additional properties like margin, padding, etc., depending on your needs.

Example Output After configuring and using the plugin, you can use both rem and px based classes like this:

html 코드 복사