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

@latehours/tailwind

v0.4.0

Published

collection of tailwind plugins

Downloads

27

Readme

@latehours/tailwind 💨

GitHub Actions Workflow Status Dependencies amount 0 NPM Downloads NPM Version GitHub License Made with vacuum cleaner package size

@latehours/tailwind is collection of plugins for Tailwind CSS that i need often enough.

is has zero dependencies. ofc you need to have tailwindcss set up in your project.

usage

install the library using your package manager of choice:

npm install @latehours/tailwind
pnpm install @latehours/tailwind
bun add @latehours/tailwind
yarn add @latehours/tailwind

ligatures plugin

define how ligatures should behave.

in your tailwind.config.mjs:

import { ligatures } from "@latehours/tailwind/ligatures";

/** @type {import('tailwindcss').Config} */
export default {
  plugins: [ligatures()],
}

in your file.html or component.tsx:

<div class="ligatures-none">no ligatures</div>
<div class="ligatures-normal">normal ligatures</div>
<div class="ligatures-none">no ligatures</div>
<div class="ligatures-common">common ligatures</div>
<div class="ligatures-no-common">no common ligatures</div>
<div class="ligatures-discretionary">discretionary ligatures</div>
<div class="ligatures-no-discretionary">no discretionary ligatures</div>
<div class="ligatures-historical">historical ligatures</div>
<div class="ligatures-no-historical">no historical ligatures</div>
<div class="ligatures-contextual">contextual ligatures</div>
<div class="ligatures-no-contextual">no contextual ligatures</div>

cn utility

merge classnames together.

first add clsx and tailwind-merge to your deps then you can use cn:

import { cn } from "@latehours/tailwind/cn";

const padding = "p-4";
const classes = cn("text-red-500", "bg-blue-500", padding);

cond utility

opinionated way to conditionally add classes. most useful when combined with cn.

first add clsx to your deps then you can use cond:

import { cn } from "@latehours/tailwind/cn";
import { cond } from "@latehours/tailwind/cond";

<div
  className={cn(
    cond(state === "selected", "bg-yellow-500"),
    cond(() => state === "disabled", "bg-gray-500"),
  )}
/>

condc utility

similar to cond but is curried. most useful when combined with cn.

first add clsx to your deps then you can use condc:

import { cn } from "@latehours/tailwind/cn";
import { condc } from "@latehours/tailwind/condc";

const isState = condc(state);

<div
  className={cn(
    isState("selected", "bg-yellow-500"),
    // also accepts third argument which is returned
    // when condition is false
    isState("disabled", "bg-gray-500", "bg-yellow-500"),
  )}
/>

development

To install dev dependencies:

bun install

when creating commits follow the conventional commits format.