tailwind-psuedo
v0.1.1
Published
A cleaner way to write psuedo elements code with tailwindcss
Downloads
1
Readme
tailwind-psuedo
A tiny utility function to join tailwind psuedo classes to together.
Installation
npm
npm install tailwind-psuedo
yarn
yarn add tailwind-psuedo
bun
bun add tailwind-psuedo
How to use?
To use the library, simply import it into your jsx/tsx file and call the twPsuedo() function with an object of pseudo element styles. For example:
example:
import { twPsuedo } from "tailwind-psuedo";
export function Button(){
return <button className={twPsuedo({
after: 'bg-red-400 text-white border-xl'
)}>Click Me</button>
}
Which will be translated into below code while run time.
<button class="after:bg-red-400 after:text-white after:border-xl">Click Me</button>
Contributing
Here's how you can contribute:
- Open an issue if you believe you've encountered a bug.
- Make a pull request to add new features/make quality-of-life improvements/fix bugs.
License
Licensed under the MIT license.