Tailwindcss utilities for add stripe background to section
npm install @designbycode/tailwindcss-stripesbash
pnpm add @designbycode/tailwindcss-stripes
`
#### Using npm
`bash
npm install @designbycode/tailwindcss-stripes
`
#### Using yarn
`bash
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:
`javascript
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.
$3
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.
`html
`
#### 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.
`html
`
#### 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.
`html
`
#### 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.
`html
`
#### 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.
`html
`
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.
`javascript
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,
],
};
``