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

tw-broken-border

v0.0.5

Published

A broken border plugin for TailwindCSS

Readme

About

This plugin was made because it was needed for a personal project and I had the idea to port it to an npm package and to have a few more features for myself that I was missing. Overall it's a pretty simple plugin with a few caveats due to tailwinds plugin api.

Instalation

First install the plugin from npm:

npm i tw-broken-border

Then add the plugin to your tailwind.config.js

import forms from '@tailwindcss/forms';
//Add the broken border plugin:
import brokenBorder from 'tw-broken-border';

/** @type {import('tailwindcss').Config} */
export default {
  content: ['./src/**/*.{html,js,svelte,ts}'],

  theme: {
    extend: {}
  },
  // Add the plugin to the plugin array
  plugins: [forms, brokenBorder]
};

Usage

After adding the plugin you can freely use it as such:

<div class="broken-blue-500 w-full px-4 flex flex-col gap-2">
  <div class="w-full py-4 broken-b-blue-400-sm/sm">
    <h2 class="text-center">Broken Borders are very cool</h2>
  </div>
  <div class="p-4 text-foreground-700">
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Placeat, quos! Minima, obcaecati? Deleniti, non velit deserunt fugit recusandae veritatis aspernatur!
  </div>
</div>

General info

The plugin provides utils for generating broken borders with adjustable sides, lengths, gaps, colors. The width has to be controlled from the theme:

    <div class="broken-<side>-<color>-<length>/gap">broken border</div>

The sides provided are:

| Prefix | Side | |-----------------|---------------------| | t | top | | b | bottom | | r | right | | l | left | | xb | left-right-bottom | | xt | left-right-top | | yr | top-bottom-right | | yl | top-bottom-left | | (no modifier) | all sides |

The default length values provided by the plugin are:

      brokenLength: {
        DEFAULT: "21px",
        sm: "15px",
        md: "27px",
        lg: "32px",
        xl: "40px",
      },

Caveats and Limitations

Due to the fact that CSS doesn't provide control over dashed or dotter border styles, they have to be created by using backround-image properties which looks something like this:

.example-broken-top {
    background-image: repeating-linear-gradient(90deg, COLOR, COLOR LENGTH, transparent LENGTH, transparent calc(GAP + LENGTH));
    background-position: left top;
    background-repeat: repeat-x;
    background-size: 100% WIDTH;
}

Due to this fact, only the length property in the class supports arbitrary values, because color is matched statically from your provided theme. The gap is provided as a modifier due to limitations by the matchUtilities function from Tailwind plugin api.

So you can't do something like this:

<div class="broken-t-[#be123c]-sm/[40px]"></div>

Because neither the color nor the modifier are dynamic, you can use arbitrary values for the length property:

<div class="broken-t-rose-700-[12px]/lg"></div>

The solution if you want to have different colors, gaps and widths is to extend the theme in your tailwind.config.(js/ts):

export default {
  content: ['./src/**/*.{html,js,svelte,ts}'],
  theme: {
    extend: {
      // Any values added to the color theme will be used by the plugin when generating static color classes
      colors: {
        primary: {
            DEFAULT: "#be185d",
            foreground: "#fce7f3"
        }
      },
      // The length values can be adjusted by extending the theme called brokenLength
      brokenLength: {
        "2xl": "46px"
      },
      // The gap values used in the modifier can also be adjusted from the theme:
      brokenGap: {
        "2xl": "36px",

      },
      //Currently there's no controllable width, so broken borders will all have the same width, you can adjust it from the theme as well:
      brokenWidth: "4px"
  },