Thanks to visit codestin.com
Credit goes to github.com

Skip to content

flornkm/dither-plugin

Repository files navigation

masked dither image of a flower

TailwindCSS Dither Plugin (Safari Compatible)

A TailwindCSS plugin that provides Safari-compatible dither effects without relying on SVG filters making dithering easy, performant, and accessible.

Usage

To start using the dither-plugin, install with the following command:

npm install dither-plugin

Then, add the plugin to your index.css file where you also reference TailwindCSS:

@import "tailwindcss";
@import "dither-plugin";

To activate it, add a <div> around the elements that should be dithered and add the dither class to it.

<div className="dither">
  <Component />
</div>

You can play around with different sizes, e.g. dither-xl.

Note that the class won't be applied when added directly to an img or video element, as these elements don't support ::after pseudo-elements.

It's as easy as that! You can play around with it.

Documentation and examples

A documentation and examples can be found here.

Feel free to follow me on Twitter @flornkm or on GitHub.

License

MIT

About

A plugin for tailwindcss to dither things.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages