tailwind_merge 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -3
- data/README.md +1 -1
- data/Rakefile +0 -2
- data/lib/tailwind_merge/class_utils.rb +3 -3
- data/lib/tailwind_merge/config.rb +1 -1
- data/lib/tailwind_merge/version.rb +1 -1
- data/lib/tailwind_merge.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beca3bcf02bb383ab1253a916c676f352a1b85e971cb9a3e903652671e6d2f8c
|
4
|
+
data.tar.gz: e7bb2df3ba1835f4eac421e27cacba0104eb258b73ff144a3027e2c6c7996e5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 925b34356bde635711ce8e614a67a4bf8b96206436443c70b5fe5d7267ba049c88f150c66eb4b0b1b6cf087d106fbc4246edde09e2aa2b5ff90292b477c0f33d
|
7
|
+
data.tar.gz: 3f44962ec002d57cdf37e32b96df52891d88e1c6012443bb2d6f3b5935b0b56bc111f8f504a90684f78ca6b8e3e087e70c7e8f16db15be1757b6703ec963b1f9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [v0.1.1](https://github.com/gjtorikian/tailwind_merge/tree/v0.1.1) (2022-10-11)
|
4
4
|
|
5
|
-
|
5
|
+
[Full Changelog](https://github.com/gjtorikian/tailwind_merge/compare/v0.1.0...v0.1.1)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- Should arrays be supported? [\#1](https://github.com/gjtorikian/tailwind_merge/issues/1)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Fix h-min [\#3](https://github.com/gjtorikian/tailwind_merge/pull/3) ([gjtorikian](https://github.com/gjtorikian))
|
14
|
+
- Fix example in README [\#2](https://github.com/gjtorikian/tailwind_merge/pull/2) ([marcoroth](https://github.com/marcoroth))
|
15
|
+
|
16
|
+
## [v0.1.0](https://github.com/gjtorikian/tailwind_merge/tree/v0.1.0) (2022-08-15)
|
17
|
+
|
18
|
+
[Full Changelog](https://github.com/gjtorikian/tailwind_merge/compare/e748f00d53e86ece8ce2543735f3327cb30c1959...v0.1.0)
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/README.md
CHANGED
@@ -73,7 +73,7 @@ tailwind-merge overrides conflicting classes and keeps everything else untouched
|
|
73
73
|
### Resolves non-trivial conflicts
|
74
74
|
|
75
75
|
```ruby
|
76
|
-
|
76
|
+
@merger.merge('inset-x-px -inset-1') # → '-inset-1'
|
77
77
|
@merger.merge('bottom-auto inset-y-6') # → 'inset-y-6'
|
78
78
|
@merger.merge('inline block') # → 'block'
|
79
79
|
```
|
data/Rakefile
CHANGED
@@ -63,7 +63,7 @@ module TailwindMerge
|
|
63
63
|
|
64
64
|
prefixed_class_group_entries = get_prefixed_class_group_entries(
|
65
65
|
config[:class_groups].map { |cg| [cg[0], cg[1]] },
|
66
|
-
prefix
|
66
|
+
prefix,
|
67
67
|
)
|
68
68
|
|
69
69
|
prefixed_class_group_entries.each do |(class_group_id, class_group)|
|
@@ -103,7 +103,7 @@ module TailwindMerge
|
|
103
103
|
class_definition.call(@config),
|
104
104
|
class_part_object,
|
105
105
|
class_group_id,
|
106
|
-
theme
|
106
|
+
theme,
|
107
107
|
)
|
108
108
|
next
|
109
109
|
end
|
@@ -121,7 +121,7 @@ module TailwindMerge
|
|
121
121
|
class_group,
|
122
122
|
get_class_part(class_part_object, key),
|
123
123
|
class_group_id,
|
124
|
-
theme
|
124
|
+
theme,
|
125
125
|
)
|
126
126
|
end
|
127
127
|
end
|
@@ -583,7 +583,7 @@ module TailwindMerge
|
|
583
583
|
# Height
|
584
584
|
# @see https://tailwindcss.com/docs/height
|
585
585
|
##
|
586
|
-
"h" => [{ "h" =>
|
586
|
+
"h" => [{ "h" => ["auto", "min", "max", "fit", SPACING] }],
|
587
587
|
##
|
588
588
|
# Min-Height
|
589
589
|
# @see https://tailwindcss.com/docs/min-height
|
data/lib/tailwind_merge.rb
CHANGED
@@ -53,7 +53,7 @@ module TailwindMerge
|
|
53
53
|
# @example 'md:!pr'
|
54
54
|
class_groups_in_conflict = Set.new
|
55
55
|
|
56
|
-
classes.strip.split(SPLIT_CLASSES_REGEX).map do |original_class_name|
|
56
|
+
classes.strip.split(SPLIT_CLASSES_REGEX).uniq.map do |original_class_name|
|
57
57
|
modifiers, has_important_modifier, base_class_name = split_modifiers(original_class_name)
|
58
58
|
|
59
59
|
class_group_id = @class_utils.class_group_id(base_class_name)
|
@@ -96,6 +96,7 @@ module TailwindMerge
|
|
96
96
|
end.reverse.map { |parsed| parsed[:original_class_name] }.join(" ")
|
97
97
|
end
|
98
98
|
|
99
|
+
SPLIT_MODIFIER_REGEX = /[:\[\]]/
|
99
100
|
private def split_modifiers(class_name)
|
100
101
|
modifiers = []
|
101
102
|
|
@@ -105,7 +106,7 @@ module TailwindMerge
|
|
105
106
|
ss = StringScanner.new(class_name)
|
106
107
|
|
107
108
|
until ss.eos?
|
108
|
-
portion = ss.scan_until(
|
109
|
+
portion = ss.scan_until(SPLIT_MODIFIER_REGEX)
|
109
110
|
|
110
111
|
if portion.nil?
|
111
112
|
ss.terminate
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tailwind_merge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen J. Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lru_redux
|