Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rmznkapar/winc
A simple utility for conditionally joining class names together
https://github.com/rmznkapar/winc
classname css tailwind
Last synced: about 1 month ago
JSON representation
A simple utility for conditionally joining class names together
- Host: GitHub
- URL: https://github.com/rmznkapar/winc
- Owner: rmznkapar
- License: mit
- Created: 2022-11-12T10:55:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-05T04:05:53.000Z (almost 2 years ago)
- Last Synced: 2024-12-20T13:24:37.359Z (about 2 months ago)
- Topics: classname, css, tailwind
- Language: TypeScript
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# winc
A simple utility for conditionally joining class names together## Usage
```js
import winc from 'winc';winc("tag bg-primary", [true, "text-white", "text-primary bg-opacity-30"])
//=> 'tag bg-primary text-white'winc("tag bg-primary", [true, "text-white", "text-primary bg-opacity-30"])
//=> 'p-4'winc("mb-2 font-bold", ['', "text-lg", "text-sm"])
//=> 'mb-2 font-bold text-sm'winc([{ users: [] }, "relative", "absolute"])
//=> 'relative'winc([true, "bottom-0", "bottom-32"])
//=> 'bottom-0'winc([{ absolute: true, "text-error": false, "font-bold": true })
//=> 'absolute font-bold'winc([false, "text-success", "text-error"], { absolute: true })
//=> 'text-error absolute'winc(false ? "block" : "opacity-0 hidden", "mt-2")
//=> 'opacity-0 hidden mt-2'```