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

@stefanracic/tailwind-next

v1.0.2

Published

A Tailwind that lets you target subsequent-sibling or "next" element

Downloads

6

Readme

tailwind-next

A TailwindCSS Plugin that lets you target subsequent-sibling or "next" element.

<div>
  <input type="checkbox" class="next-p:checked:bg-blue-500 next-h2:checked:bg-red-500">
  <p>
    Next Element
  </p>
  <h2>
    Another Element
  </h2>
<div>

Generates this CSS which gives p element or any other element that is next in line to the selector one "bg-red-500":

.next-h2\:checked\:bg-red-500:checked ~ h2 {
  --tw-bg-opacity: 1;
  background-color: rgb(239 68 68 / var(--tw-bg-opacity));
}
.next-p\:checked\:bg-blue-500:checked ~ p {
  --tw-bg-opacity: 1;
  background-color: rgb(59 130 246 / var(--tw-bg-opacity));
}

Includes all default HTML tags:

    nextTags: {
      all: "*",
      html: "html",
      base: "base",
      head: "head",
      link: "link",
      meta: "meta",
      style: "style",
      title: "title",
      address: "address",
      article: "article",
      aside: "aside",
      footer: "footer",
      header: "header",
      h1: "h1",
      h2: "h2",
      h3: "h3",
      h4: "h4",
      h5: "h5",
      h6: "h6",
      main: "main",
      nav: "nav",
      section: "section",
      body: "body",
      blockquote: "blockquote",
      dd: "dd",
      div: "div",
      dl: "dl",
      dt: "dt",
      figcaption: "figcaption",
      figure: "figure",
      hr: "hr",
      li: "li",
      ol: "ol",
      p: "p",
      pre: "pre",
      ul: "ul",
      a: "a",
      abbr: "abbr",
      b: "b",
      bdi: "bdi",
      bdo: "bdo",
      br: "br",
      cite: "cite",
      code: "code",
      data: "data",
      dfn: "dfn",
      em: "em",
      i: "i",
      kbd: "kbd",
      mark: "mark",
      q: "q",
      rp: "rp",
      rt: "rt",
      ruby: "ruby",
      s: "s",
      samp: "samp",
      small: "small",
      span: "span",
      strong: "strong",
      sub: "sub",
      sup: "sup",
      time: "time",
      u: "u",
      var: "var",
      wbr: "wbr",
      area: "area",
      audio: "audio",
      img: "img",
      map: "map",
      track: "track",
      video: "video",
      embed: "embed",
      iframe: "iframe",
      object: "object",
      param: "param",
      picture: "picture",
      portal: "portal",
      source: "source",
      svg: "svg",
      math: "math",
      canvas: "canvas",
      noscript: "noscript",
      script: "script",
      del: "del",
      ins: "ins",
      caption: "caption",
      col: "col",
      colgroup: "colgroup",
      table: "table",
      tbody: "tbody",
      td: "td",
      tfoot: "tfoot",
      th: "th",
      thead: "thead",
      tr: "tr",
      button: "button",
      datalist: "datalist",
      fieldset: "fieldset",
      form: "form",
      input: "input",
      label: "label",
      legend: "legend",
      meter: "meter",
      optgroup: "optgroup",
      option: "option",
      output: "output",
      progress: "progress",
      select: "select",
      textarea: "textarea",
      details: "details",
      dialog: "dialog",
      menu: "menu",
      summary: "summary",
      slot: "slot",
      template: "template",
      acronym: "acronym",
      applet: "applet",
      basefont: "basefont",
      bgsound: "bgsound",
      big: "big",
      blink: "blink",
      center: "center",
      content: "content",
      dir: "dir",
      font: "font",
      frame: "frame",
      frameset: "frameset",
      hgroup: "hgroup",
      image: "image",
      keygen: "keygen",
      marquee: "marquee",
      menuitem: "menuitem",
      nobr: "nobr",
      noembed: "noembed",
      noframes: "noframes",
      plaintext: "plaintext",
      rb: "rb",
      rtc: "rtc",
      shadow: "shadow",
      spacer: "spacer",
      strike: "strike",
      tt: "tt",
      xmp: "xmp"
    }

Expandable using theme/extend

module.exports = {
  content: [],
  theme: {
    extend: {
      nextTags: {
        custom: 'custom',
        ".selector": ".selector",
      },
    },
  },
  plugins: [],
}

You can even use custom class/ID selectors like .selector in example above. Which will generate:

.next-someEl\:bg-black ~ custom {
  --tw-bg-opacity: 1;
  background-color: rgb(0 0 0 / var(--tw-bg-opacity));
}

.next-\.selector\:bg-purple-500 ~ .selector {
  --tw-bg-opacity: 1;
  background-color: rgb(168 85 247 / var(--tw-bg-opacity));
}

The order of Variants when writing a class can be a bit weird but currently TW Compiles it in a "reverse" way so it is what it is... for now.