Skip to content

Commit fbf75bd

Browse files
authored
Merge pull request #4 from wrabit/fix_and_features
Fix and features
2 parents 4f5a304 + 54f5e06 commit fbf75bd

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

README.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ This utility ensures that when you combine multiple strings of Tailwind classes
1111

1212
Using pip:
1313
```bash
14-
pip install tailwind-merge # Assuming this is the package name you'll use
15-
# Or if installing directly from source:
16-
# pip install .
14+
pip install tailwind-merge
1715
```
1816

1917
## Usage
2018

2119
```python
22-
from tailwind_merge import TailwindMerge # Adjust import if your file/package name differs
20+
from tailwind_merge import TailwindMerge
2321

24-
# Initialize the merger (you can reuse the instance)
22+
# Initialize
2523
twm = TailwindMerge()
2624

2725
# --- Basic Merging ---
@@ -39,14 +37,6 @@ result = twm.merge("pl-4 pr-6") # Left and Right padding coexist
3937
print(result)
4038
# Output: "pl-4 pr-6"
4139

42-
result = twm.merge("p-4 pl-8") # Specific left padding overrides general padding affecting left
43-
print(result)
44-
# Output: "pl-8" # Or potentially "p-4 pl-8" depending on exact conflict rules for p-* vs pl-*
45-
46-
result = twm.merge("pl-8 p-4") # General padding defined later overrides specific padding
47-
print(result)
48-
# Output: "p-4"
49-
5040
# --- Modifier Handling ---
5141
# Modifiers (hover:, focus:, md:, etc.) are handled correctly.
5242
# Conflicts are resolved independently for base classes and each modifier combination.
@@ -60,13 +50,9 @@ print(result)
6050

6151
# --- Arbitrary Value Support ---
6252
# Classes with arbitrary values are correctly grouped and merged.
63-
result = twm.merge("p-[2px] p-1")
64-
print(result)
65-
# Output: "p-1"
66-
67-
result = twm.merge("m-1 m-[3vh]")
53+
result = twm.merge("p-1", "p-[2px]")
6854
print(result)
69-
# Output: "m-[3vh]"
55+
# Output: "p-[2px]"
7056

7157
# --- Combining Multiple Strings ---
7258
# Pass multiple strings as arguments

tailwind_merge/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .core import TailwindMerge
22

3-
__version__ = "0.1.0"
3+
__version__ = "0.3.0"
44
__all__ = ["TailwindMerge"]

tailwind_merge/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def __init__(self):
181181
('border_width_r', ['border-r', 'border-r-0', 'border-r-2', 'border-r-4', 'border-r-8']),
182182
('border_width_b', ['border-b', 'border-b-0', 'border-b-2', 'border-b-4', 'border-b-8']),
183183
('border_width_l', ['border-l', 'border-l-0', 'border-l-2', 'border-l-4', 'border-l-8']),
184-
# Tailwind also has border-x, border-y but let's keep it simpler for now or add if needed
185184
# --- End Border Width ---
186185

187186
# Border Color (Needs care with opacity potentially)

0 commit comments

Comments
 (0)