Skip to content

Commit 286d37e

Browse files
committed
feat: config
1 parent 55b274a commit 286d37e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

pkg/twmerge/config.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package twmerge
2+
3+
type TwMergeConfig struct {
4+
// defaults should be good enough
5+
// hover:bg-red-500 -> :
6+
ModifierSeparator rune
7+
// bg-red-500 -> -
8+
ClassSeparator rune
9+
// !bg-red-500 -> !
10+
ImportantModifier rune
11+
// used for bg-red-500/50 (50% opacity) -> /
12+
PostfixModifier rune
13+
// optional
14+
Prefix string
15+
16+
// CACHE
17+
MaxCacheSize int
18+
// I couldn't figure out what they use the theme for
19+
// Theme TwTheme
20+
21+
// This is a large map of all the classes and their validators -> see default-config.go
22+
ClassGroups ClassPart
23+
24+
// class group with conflict + conflicting groups -> if "p" is set all others are removed
25+
// p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl']
26+
ConflictingClassGroups ConflictingClassGroups
27+
}
28+
29+
// type TwTheme struct {
30+
// }
31+
32+
type ClassGroupValidator struct {
33+
Fn func(string) bool
34+
ClassGroupId string
35+
}
36+
type ClassPart struct {
37+
NextPart map[string]ClassPart
38+
Validators []ClassGroupValidator
39+
ClassGroupId string
40+
}
41+
42+
type ConflictingClassGroups map[string][]string

0 commit comments

Comments
 (0)