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

@designbycode/tailwindcss-stripes

v1.0.5

Published

Tailwindcss utilities for add stripe background to section

Downloads

220

Readme

Tailwind CSS Stripes Plugin

npm version npm NPM npm bundle size ts GitHub stars HitCount

The Tailwind CSS Stripes Plugin provides a set of utility classes and components that allow you to easily create striped backgrounds for your HTML elements. It offers a flexible way to customize the color, size, opacity, and animation direction of the stripes.

Stripes Plugin

📇 Table of Contents

Installation

To use the Tailwind CSS Stripes Plugin, you need to have Tailwind CSS installed in your project. If you don't have it yet, you can follow the installation guide to set it up.

Once you have Tailwind CSS installed, you can add the Stripes Plugin to your project using pnpm, npm or yarn:

Using pnpm

pnpm add @designbycode/tailwindcss-stripes

Using npm

npm install @designbycode/tailwindcss-stripes

Using yarn

yarn add @designbycode/tailwindcss-stripes

Configuration

To enable the Stripes Plugin, you need to add it to your Tailwind CSS configuration file. Open your tailwind.config.js and import the plugin at the top of the file:

module.exports = {
    // Your existing configuration...
    plugins: [
        // Other plugins...
        require("@designbycode/tailwindcss-stripes"),
    ],
};

Usage

Once the Stripes Plugin is installed and added to your configuration, you can start using the utility classes and components to create striped backgrounds.

Utility Classes

The plugin provides the following utility classes:

Stripes Utility

.stripes The .stripes class creates a container with relative positioning, isolates its contents from being affected by the animation, and hides any overflowing content. It serves as the base class for creating the striped effect.


<div class="stripes">
    <!-- Your content here -->
</div>

Stripes Color Modifier

.stripes-{value}

The .stripes-{value} class sets the color of the stripes to selected value. You can use it to create any color stripes on your elements.


<div class="stripes stripes-rose-500">
    <!-- Your content here -->
</div>

<!-- by color name or arbitrary value -->

<div class="stripes stripes-[chocolate] stripes-[#ff000]">
    <!-- Your content here -->
</div>

Stripes Direction Modifier

.stripes-reverse

The .stripes-reverse class reverses the direction of the stripes' animation. It creates a cool effect where the stripes appear to move in the opposite direction.


<div class="stripes stripes-reverse">
    <!-- Your content here -->
</div>

Stripes Opacity Modifier

.stripes-opacity-{value}

The .stripes-opacity-{value} classes allow you to control the opacity of the stripes. Replace {value} with the desired opacity level. The available values are defined in your Tailwind CSS opacity configuration.


<div class="stripes stripes-opacity-50">
    <!-- Your content here -->
</div>

<!-- or by arbitrary value -->
<div class="stripes stripes-opacity-[0.12]">
    <!-- Your content here -->
</div>

Stripes Size Modifier

.stripes-size-{value}

The .stripes-size-{value} classes let you adjust the size of the stripes. Replace {value} with one of the custom stripe sizes defined in your Tailwind CSS stripeSizes configuration.


<div class="stripes stripes-size-md">
    <!-- Your content here -->
</div>
<!-- or by arbitrary size value -->
<div class="stripes stripes-size-[42px]">
    <!-- Your content here -->
</div>

Customization

You can customize the plugin by modifying the theme section in your Tailwind CSS configuration file. The plugin allows you to define custom stripe sizes and use them as utility classes.

module.exports = {
    theme: {
        extend: {
            stripeSizes: {
                // Define your custom stripe sizes here
                xs: "4px",
                sm: "8px",
                md: "16px",
                lg: "24px",
                xl: "32px",
                "2xl": "40px",
                "3xl": "48px",
            },
        },
    },
    plugins: [
        // Other plugins...
        stripesPlugin,
    ],
};

By adding or modifying the custom stripe sizes, you can use the .stripes-size-{value} utility classes with your defined sizes.

Conclusion

The Tailwind CSS Stripes Plugin simplifies the process of creating striped backgrounds with utility classes and components. You can easily apply striped patterns to your elements using the provided classes and customize their appearance according to your project's needs. The plugin offers control over colors, sizes, opacity, and animation direction, making it a powerful addition to your Tailwind CSS toolkit.

Contributing

Contributions to this plugin are welcome! If you encounter any issues, have feature requests, or want to improve the plugin, feel free to create a pull request or submit an issue on the GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Acknowledgments

  • This plugin is inspired by the needs of web developers using Tailwind CSS.
  • Special thanks to the Tailwind CSS team for creating such an amazing framework.