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 🙏

© 2024 – Pkg Stats / Ryan Hefner

kazeno

v0.1.1

Published

CSS utility classes

Downloads

2

Readme

kazeno

What if we just take Tailwind CSS defaults and stick them into a giant hash map?

You would get this.

  • The majority of Tailwind CSS defaults
  • Support for most pseudo-class variants and media query modifiers
  • A "JIT compiler". No I'm no Mike Pall; it's a script that scans your source files and builds a string. But this is the terminology the Tailwind guys use, and it makes me sound smarter than I am.

Usage

npm install kazeno --save-dev
  1. Write a build script
// build.js
import { build } from 'kazeno';

await build({
  // path containing your source files
  path: './src',
  // file extensions to scan
  ext: /\.(js|jsx|ts|tsx)$/,
  // where to save the css containing all of your classes
  output: './app.css',
  // include normalization CSS
  preflight: true
})
  1. Use some Tailwind CSS classes
// src/App.jsx
import { h } from 'preact';

const App = () => (
  <p className="font-serif bg-gray-300 hover:font-mono hover:bg-blue-300">
    hello
  </p>
);
  1. Run your build script
node build.js
  1. Your CSS will contain only the classes you need (+ preflight CSS if enabled)
/* app.css */
.font-serif { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; }
.bg-gray-300 { background-color: rgb(209 213 219); }
.hover\:font-mono:hover { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.hover\:bg-blue-300:hover { background-color: rgb(147 197 253); }

But why?

Years ago, I was a user and proponent of basscss, a tiny CSS library that arguably sparked this whole atomic CSS craze (along with Tachyons). It was small, focused, and immensely useful when paired with a UI library like Mithril or React. Tailwind soon entered the scene, and became the de-facto atomic CSS library through dev power and lots and lots of marketing. WindiCSS innovated on the ideas of Tailwind and introduced the original "JIT" solution, speeding up dev and build times with its incremental approach. Tailwind soon followed after with their own JIT solution, and the minds behind Windi soon went on to create UnoCSS.

Despite all this churn, I miss the simplicity and opinionated nature of Basscss which clocked in around 2kb without any build steps or purging (meanwhile, a Tailwind local install is 9MB and ropes in ~70 or so dependencies). The JIT approach seems like a nice and sensible alternative to purging, so I wanted to see what could be done with a weekend's worth of effort. If anything, the next iteration of this will look more like Basscss since I prefer their class naming scheme to Tailwind's.

Should I use this?

For your livelihood? Probably not. For your toy project? Go for it, and let me know of any breakage. Some notable things missing from this:

  • No customization
  • Not all psuedo variants are implemented
  • Gradients are not implemented
  • Probably more

Inspiration

TailwindCSS and WindiCSS.