Skip to content

Commit 49007b2

Browse files
committed
chore(docs): update README with new features
1 parent f0c23ec commit 49007b2

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,37 @@ Please [follow the guide](https://tailwindcss.com/docs/installation/) to set up
2525
npm install tailwindcss-classnames
2626
```
2727

28-
**⚠️ NOTE:** This project versions match with TailwindCSS versions except for [semver _patch_](https://semver.org/) releases
28+
**NOTE:** This project versions match with TailwindCSS versions except for [semver _patch_](https://semver.org/) releases
2929

3030
The project is literally the [classnames](https://www.npmjs.com/package/classnames) project with custom typing. That means it arrives at your browser at approximately **370b** minified and gzipped ([bundlephobia](https://bundlephobia.com/result?p=tailwindcss-classnames)).
3131

32+
## **Whats New in v3**
33+
34+
- Way better performance overall (thanks to [@dylanvann](https://github.com/DylanVann)'s [idea and suggestions](https://github.com/muhammadsammy/tailwindcss-classnames/pull/281#discussion_r731682711)):
35+
36+
- Generated file size is reduced to be **< 200 KB** (default config). Previous version was generating a file sized about [100 MB](https://github.com/muhammadsammy/tailwindcss-classnames/issues/282).
37+
- Fast autocompletion: this is due to usage of more specific utility functions and using template string types
38+
39+
- **BREAKING**: Dropped support for JIT engine's Colors Opacity suffix feature (due to TypesScript _TS2590_ error)
40+
41+
- **BREAKING**: Create Utility functions that accepts classnames (and pseudoclassnames) of that category. The `classnames` function won't accept or show autocompletion of all classnames anymore, but it will accept a function of these category functions [(#293)](https://github.com/muhammadsammy/tailwindcss-classnames/issues/293)
42+
43+
✅ Correct
44+
45+
```ts
46+
classnames(
47+
display('flex', 'md:block'),
48+
textColor('text-black', 'hover:text-red-600'),
49+
flexDirection('flex-row-reverse'),
50+
);
51+
```
52+
53+
❌ Incorrect
54+
55+
```ts
56+
classnames('flex', 'md:block', 'text-black', 'hover:text-red-600', 'flex-row-reverse');
57+
```
58+
3259
## Create classes
3360

3461
```js
@@ -108,10 +135,10 @@ The types included in this package are the default tailwindcss classes, but if y
108135

109136
### CLI arguments
110137

111-
- `-i`, `--input` Name or relative path of the TailwindCSS config file **(if not provided, tries to find 'tailwind.config.js')**
112-
- `-o`, `--output` Name or relative path of the generated types file **(optional, default: "tailwindcss-classnames.ts")**
113-
- `-x`, `--extra` Name or relative path of the file with the custom extra types **(optional)**
114-
- `-h`, `--help` display help for command
138+
- `-i`, `--input` Name or relative path of the TailwindCSS config file **(if not provided, tries to find 'tailwind.config.js')**
139+
- `-o`, `--output` Name or relative path of the generated types file **(optional, default: "tailwindcss-classnames.ts")**
140+
- `-x`, `--extra` Name or relative path of the file with the custom extra types **(optional)**
141+
- `-h`, `--help` display help for command
115142

116143
### Example of CLI usage
117144

@@ -135,11 +162,10 @@ type MyCustomType =
135162
136163
### Known limitiations
137164
138-
- Relative imports inside the config does not work. use `__dirname` instead. See [#120](https://github.com/muhammadsammy/tailwindcss-classnames/issues/120) for details.
139-
- Only official TailwindLabs plugins are supported.
165+
- Relative imports inside the config does not work. use `__dirname` instead. See [#120](https://github.com/muhammadsammy/tailwindcss-classnames/issues/120) .
140166
- `npx tailwindcss-classnames` won't work. Use as an npm script as mentioned above.
141-
- Limited support for the JIT engine ([#204](https://github.com/muhammadsammy/tailwindcss-classnames/issues/204)).
142-
- [Backlog](https://github.com/muhammadsammy/tailwindcss-classnames/milestone/2)
167+
- Only official TailwindLabs plugins are supported.
168+
- Some JIT features are not supported ([#204](https://github.com/muhammadsammy/tailwindcss-classnames/issues/204)).
143169
144170
Any help with these issues is very much appreciated.
145171

0 commit comments

Comments
 (0)