Skip to content

Commit 5ff2128

Browse files
committed
docs: added readme
1 parent fd3ef75 commit 5ff2128

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# tailwind-merge-go
2+
3+
Utility function to efficiently merge Tailwind CSS classes in Golang without style conflicts. This library aims to be as close as possible to a 1:1 copy of the original tailwind-merge library written in javascript.
4+
5+
```go
6+
import (
7+
"fmt"
8+
9+
"github.com/Oudwins/tailwind-merge-go/pkg/twmerge"
10+
)
11+
12+
func main() {
13+
14+
// example usage
15+
c := twmerge.Merge("px-4 px-10 p-1")
16+
fmt.Println(c) // "p-1"
17+
}
18+
```
19+
20+
- Supports Tailwind v3.0 up to v3.4
21+
- Support for extending the default configuration
22+
- Support for providing your own caching solution
23+
24+
## [Why use it?](https://github.com/dcastil/tailwind-merge/blob/v2.2.1/docs/what-is-it-for.md)
25+
26+
- See [tailwind-merge](https://github.com/dcastil/tailwind-merge/blob/v2.2.1/docs/what-is-it-for.md)
27+
28+
## [Limitations](https://github.com/dcastil/tailwind-merge/blob/v2.2.1/docs/limitations.md)-
29+
30+
- See [tailwind-merge](https://github.com/dcastil/tailwind-merge/blob/v2.2.1/docs/limitations.md)
31+
32+
## Roadmap
33+
34+
- Write contributing docs
35+
- Improve current docs
36+
- Improve cache concurrent performance by locking on a per key basis -> https://github.com/EagleChen/mapmutex
37+
- Split code into multiple pkgs so in the twmerge pkg there is only the Merge & CreateTailwindMerge functions
38+
- Build the class map on initialization and have a simple config style
39+
- replace regex with more performant solution
40+
- Move arbitrary value delimeters '[' & ']' to config somehow?
41+
42+
## Acknowledgments
43+
44+
- Credit for all the hard work goes to [dcastil/tailwind-merge](https://github.com/dcastil/tailwind-merge/).
45+
- For the tests I used
46+
- For the approach and the code. I mostly translated from js to go
47+
- Big thank you to [tylantz/go-tailwind-merge/](https://github.com/tylantz/go-tailwind-merge/tree/main) for pushing me to finally do this by writing a very interesting version of this same idea (I encourage you to check it out) and for the code to generate a go test file based on tailwind-merge's tests

0 commit comments

Comments
 (0)