Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: heroui-inc/tailwind-variants
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.1
Choose a base ref
...
head repository: heroui-inc/tailwind-variants
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.0
Choose a head ref
  • 2 commits
  • 16 files changed
  • 2 contributors

Commits on Mar 8, 2025

  1. feat: support tailwindcss v4 (#245)

    * feat: support tailwindcss v4
    
    * feat: support tailwindcss v4
    
    * fix: pkg
    winchesHe authored Mar 8, 2025
    Copy the full SHA
    00ec267 View commit details
  2. feat: v1

    jrgarciadev committed Mar 8, 2025
    Copy the full SHA
    dddef3a View commit details
Showing with 75 additions and 2,299 deletions.
  1. +5 −41 README.md
  2. +0 −5 clean-package.config.json
  3. +16 −20 package.json
  4. +33 −169 pnpm-lock.yaml
  5. +0 −399 src/__tests__/createTV.test.ts
  6. +0 −613 src/__tests__/transformer.test.ts
  7. +0 −611 src/__tests__/tv.test.ts
  8. +1 −18 src/config.d.ts
  9. +0 −3 src/generated.d.ts
  10. +0 −7 src/generator.d.ts
  11. +0 −22 src/generator.js
  12. +20 −50 src/index.d.ts
  13. +0 −26 src/transformer.d.ts
  14. +0 −313 src/transformer.js
  15. +0 −1 transformer.d.ts
  16. +0 −1 transformer.js
46 changes: 5 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -20,17 +20,21 @@
## Features

- First-class variant API
- Responsive variants
- Slots support
- Composition support
- Fully typed
- Framework agnostic
- Automatic conflict resolution
- Tailwindcss V4 support

## Documentation

For full documentation, visit [tailwind-variants.org](https://tailwind-variants.org)

> ❕ Note: `Tailwindcss V4` no longer supports the `config.content.transform` so we remove the `responsive variants` feature
>
> If you want to use `responsive variants`, you need to add it manually to your classname.
## Quick Start

1. Installation:
@@ -75,46 +79,6 @@ const button = tv({
return <button className={button({size: "sm", color: "secondary"})}>Click me</button>;
```

3. Responsive variants configuration (optional): If you want to use responsive variants
you need to add the Tailwind Variants `wrapper` to your TailwindCSS config file `tailwind.config.js`.

```js
// tailwind.config.js

const {withTV} = require("tailwind-variants/transformer");

/** @type {import('tailwindcss').Config} */
module.exports = withTV({
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
});
```

If you're using a custom path to import Tailwind variants, such as creating a custom tv instance with `createTV`, it's recommended to include this path in the transformer configuration:

```js
// tailwind.config.js

const {withTV} = require("tailwind-variants/transformer");

/** @type {import('tailwindcss').Config} */
module.exports = withTV(
{
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
},
{
aliases: ["@/lib/tv"],
},
);
```

## Acknowledgements

- [**cva**](https://github.com/joe-bell/cva) ([Joe Bell](https://github.com/joe-bell))
5 changes: 0 additions & 5 deletions clean-package.config.json
Original file line number Diff line number Diff line change
@@ -11,11 +11,6 @@
"types": "./dist/index.d.ts"
},
"./dist/*": "./dist/*",
"./transformer": {
"require": "./dist/transformer.cjs",
"types": "./dist/transformer.d.ts",
"default": "./dist/transformer.js"
},
"./package.json": "./package.json"
}
}
36 changes: 16 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tailwind-variants",
"version": "0.3.0",
"version": "1.0.0",
"description": "🦄 Tailwindcss first-class variant API",
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"license": "MIT",
@@ -16,16 +16,15 @@
},
"type": "module",
"main": "dist/index.cjs",
"types": "./dist/index.d.ts",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"dist",
"transformer.js",
"transformer.d.ts",
"README.md",
"LICENSE"
],
"scripts": {
"dev": "tsup --watch",
"build": "tsup && node copy-types.cjs",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
@@ -37,7 +36,7 @@
"test:watch": "jest --watch --no-verbose"
},
"dependencies": {
"tailwind-merge": "2.5.4"
"tailwind-merge": "3.0.2"
},
"devDependencies": {
"@commitlint/cli": "19.5.0",
@@ -66,10 +65,11 @@
"eslint-plugin-promise": "7.1.0",
"expect": "29.7.0",
"jest": "29.7.0",
"postcss": "8.5.3",
"prettier": "3.3.3",
"prettier-eslint": "16.3.0",
"prettier-eslint-cli": "8.0.1",
"tailwindcss": "3.4.14",
"tailwindcss": "4.0.12",
"ts-node": "10.9.2",
"tsup": "8.3.5",
"typescript": "5.6.3"
@@ -85,22 +85,18 @@
"styled",
"styles"
],
"tsup": {
"clean": true,
"minify": true,
"treeshake": true,
"entry": [
"src/*.js"
],
"target": "es2019",
"format": [
"cjs",
"esm"
]
},
"packageManager": "pnpm@9.12.3",
"engines": {
"node": ">=16.x",
"pnpm": ">=7.x"
},
"module": "dist/index.js",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./dist/*": "./dist/*",
"./package.json": "./package.json"
}
}
Loading