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

autocss

v0.0.1

Published

AutoCSS is a tool that generates CSS from a simple syntax that can be written as class-names in a HTML-document. It can be used to implement complex designs while keeping your CSS line-count to a minimum.

Readme

AutoCSS

AutoCSS is a tool that generates CSS from a simple syntax that can be written as class-names in a HTML-document. It can be used to implement complex designs while keeping your CSS line-count to a minimum.

Basic example

<div class="pa:4 c:$white bc:$pink">
  HELLO
</div>

Produces the following CSS:

.pa\:4 {
  padding: 4rem;
}
.c\:white {
  color: var(--color-white);
}
.bc\:hotpink {
  background-color: var(--color-pink);
}

This example uses variables, so you will have to set them manually, using CSS4:

:root {
  --color-white: white;
  --color-pink: hotpink;
}

Or SASS:

$color-white: white;
$color-pink: hotpink;

More examples

d:b -> display: block
d:ib -> display: inline-block
d:b@m -> display: block @ media device-width < 420px

c:#fff -> color: #fff
bc:#000 -> background-color: #000
c:$a -> color: var(--color-a)
bc:$b -> background-color: var(--color-b)

fs:1 -> font-size: 1rem
fs:24px -> font-size: 24px
lh:1 -> line-height: 1
lh:30px -> line-height: 30px

See autocss.options.map for a complete list of properties.

Usage

See .../autocss-demo.git for usage examples.

Questions?

How is this different from inline-styles?

  • AutoCSS has a different, less verbose syntax.
  • AutoCSS can be cached.

Can I use this with SASS

Yes, setting variableTemplate to "$$name" will produce SASS-compatible output.

Can I use this with Gulp?

Yes, there's a (very basic) gulp plugin, see gulp-autocss.

How can I use this when I set my class-attributes dynamically?

You have a few alternatives:

  • You can use the "preload" config option
  • Use a static HTML-file with all your dynamic classes
  • Write a custom parser