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

tailwindcss-hero-patterns

v0.1.2

Published

Tailwind CSS plugin to use Hero patterns

Downloads

1,665

Readme

Tailwind CSS Hero Patterns

npm

A simple tailwind plugin to display Hero Patterns by @steveschoger.

DEMO AVAILABLE HERE

TAILWIND PLAYGROUND

Installation

yarn add tailwindcss-hero-patterns

or

npm i tailwindcss-hero-patterns

Usage

Simple

Just include the plugin:

  plugins: [
    require('tailwindcss-hero-patterns'),
  ],

And start using it:

<div class="flex m-2 relative w-40 h-40 sm:pb-0 sm:w-48 sm:h-48 bg-red-500">
  <div
    class="bg-repeat w-full h-full text-primary-100 heropattern-jigsaw-red-100"
  >
    <div class="text-sm inline">heropattern-jigsaw-red-500</div>
  </div>
</div>

Here is the list of the available templates:

jigsaw, overcast, formalinvitation, topography, texture, jupiter, architect, cutout, hideout, graphpaper, yyy, squares, fallingtriangles, pianoman, piefactory, dominos, hexagons, charliebrown, autumn, temple, stampcollection, deathstar, churchonsunday, ilikefood, overlappinghexagons, fourpointstars, bamboo, bathroomfloor, corkscrew, happyintersection, kiwi, lips, lisbon, randomshapes, steelbeams, tinycheckers, xequals, anchorsaway, bevelcircle, brickwall, fancyrectangles, heavyrain, overlappingcircles, plus, roundedplusconnected, volcanolamp, wiggle, bubbles, cage, connections, current, diagonalstripes, flippeddiamonds, floatingcogs, glamorous, houndstooth, leaf, linesinmotion, moroccan, morphingdiamonds, rails, rain, skulls, squaresinsquares, stripes, tictactoe, zigzag, aztec, banknote, boxes, circlessquares, circuitboard, curtain, diagonallines, endlessclouds, eyes, floortile, groovy, intersectingcircles, melt, overlappingdiamonds, parkayfloor, pixeldots, polkadots, signal, slantedstars, wallpaper

Advanced Usage

Select only some templates

Hero Patterns contains more than 80 patterns, so the generated CSS could be really heavy (at least 24Mo).

3 solutions to reduce the CSS size during development:

  1. only import the desired patterns:
const heropatterns = require("tailwindcss-hero-patterns/src/patterns");

module.exports = {
  theme: {
    heroPatterns: {
      architect: heropatterns.architect,
    },
    extend: {
        ...
    },
  },
};
  1. only import the desired colors and/or shades:

module.exports = {
  theme: {
    heroPatternsShades: ["100", "500"],
    heroPatternsColors: ["blue", "red"],
    heroPatternsOpacities: ['0, '50', '90', '100'],
  },
};

And of course, don't forget to purce your CSS before going to PROD.

Add your own template

Prefined patterns comes from Hero Patterns, but you can add your own:

module.exports = {
  theme: {
    extend: {
      heroPatterns: {
        circles: `url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cpattern id='pattern-circles' x='0' y='0' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='20' cy='20' r='20'%3E%3C/circle%3E%3C/pattern%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='url(%23pattern-circles)'%3E%3C/rect%3E%3C/svg%3E");`,
      },
    },
  },
};

Contributions & debug

If you want to contribute to this project, or just play with this plugin, here is a tailwind playground demo which may interest you.

Credits

Thanks @steveschoger for all those nice patterns :-)