|
| 1 | +# Tailwind CSS Plugin – Blend Mode |
| 2 | + |
| 3 | +Utilities for controlling blending mode behaviour. |
| 4 | + |
| 5 | +## Install |
| 6 | + |
| 7 | +1. Install the plugin: |
| 8 | + |
| 9 | +```bash |
| 10 | +# Using npm |
| 11 | +npm install @neupauer/tailwindcss-plugin-blend-mode |
| 12 | + |
| 13 | +# Using Yarn |
| 14 | +yarn add @neupauer/tailwindcss-plugin-blend-mode |
| 15 | +``` |
| 16 | + |
| 17 | +2. Add it to your `tailwind.config.js` file: |
| 18 | + |
| 19 | +```js |
| 20 | +// tailwind.config.js |
| 21 | +module.exports = { |
| 22 | + // ... |
| 23 | + plugins: [require("@neupauer/tailwindcss-plugin-blend-mode")], |
| 24 | +}; |
| 25 | +``` |
| 26 | + |
| 27 | +## Configuration |
| 28 | + |
| 29 | +```js |
| 30 | +// tailwind.config.js |
| 31 | +module.exports = { |
| 32 | + variants: { |
| 33 | + // default |
| 34 | + blendMode: [], |
| 35 | + }, |
| 36 | +}; |
| 37 | +``` |
| 38 | + |
| 39 | +## Available Utilities |
| 40 | + |
| 41 | +| Utility | Style | |
| 42 | +| ------------------------ | ------------------------------------ | |
| 43 | +| `.isolate` | `isolation: isolate` | |
| 44 | +| `.no-isolate` | `isolation: auto` | |
| 45 | +| `.mix-blend-normal` | `mix-blend-mode: normal` | |
| 46 | +| `.mix-blend-multiply` | `mix-blend-mode: multiply` | |
| 47 | +| `.mix-blend-screen` | `mix-blend-mode: screen` | |
| 48 | +| `.mix-blend-overlay` | `mix-blend-mode: overlay` | |
| 49 | +| `.mix-blend-darken` | `mix-blend-mode: darken` | |
| 50 | +| `.mix-blend-lighten` | `mix-blend-mode: lighten` | |
| 51 | +| `.mix-blend-color-dodge` | `mix-blend-mode: color-dodge` | |
| 52 | +| `.mix-blend-color-burn` | `mix-blend-mode: color-burn` | |
| 53 | +| `.mix-blend-hard-light` | `mix-blend-mode: hard-light` | |
| 54 | +| `.mix-blend-soft-light` | `mix-blend-mode: soft-light` | |
| 55 | +| `.mix-blend-difference` | `mix-blend-mode: difference` | |
| 56 | +| `.mix-blend-exclusion` | `mix-blend-mode: exclusion` | |
| 57 | +| `.mix-blend-hue` | `mix-blend-mode: hue` | |
| 58 | +| `.mix-blend-saturation` | `mix-blend-mode: saturation` | |
| 59 | +| `.mix-blend-color` | `mix-blend-mode: color` | |
| 60 | +| `.mix-blend-luminosity` | `mix-blend-mode: luminosity` | |
| 61 | +| `.bg-blend-normal` | `background-blend-mode: normal` | |
| 62 | +| `.bg-blend-multiply` | `background-blend-mode: multiply` | |
| 63 | +| `.bg-blend-screen` | `background-blend-mode: screen` | |
| 64 | +| `.bg-blend-overlay` | `background-blend-mode: overlay` | |
| 65 | +| `.bg-blend-darken` | `background-blend-mode: darken` | |
| 66 | +| `.bg-blend-lighten` | `background-blend-mode: lighten` | |
| 67 | +| `.bg-blend-color-dodge` | `background-blend-mode: color-dodge` | |
| 68 | +| `.bg-blend-color-burn` | `background-blend-mode: color-burn` | |
| 69 | +| `.bg-blend-hard-light` | `background-blend-mode: hard-light` | |
| 70 | +| `.bg-blend-soft-light` | `background-blend-mode: soft-light` | |
| 71 | +| `.bg-blend-difference` | `background-blend-mode: difference` | |
| 72 | +| `.bg-blend-exclusion` | `background-blend-mode: exclusion` | |
| 73 | +| `.bg-blend-hue` | `background-blend-mode: hue` | |
| 74 | +| `.bg-blend-saturation` | `background-blend-mode: saturation` | |
| 75 | +| `.bg-blend-color` | `background-blend-mode: color` | |
| 76 | +| `.bg-blend-luminosity` | `background-blend-mode: luminosity` | |
| 77 | + |
| 78 | +## Usage |
| 79 | + |
| 80 | +```html |
| 81 | +<div class="bg-blend-hue"></div> |
| 82 | +<div class="mix-blend-color"></div> |
| 83 | +<div class="isolate mix-blend-darken"></div> |
| 84 | +``` |
0 commit comments