tailwind_merge 0.10.2 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5aa6b6ffac6e2a45168871d6c032809d11c70f16106a15160d3f1072f71d8ccd
4
- data.tar.gz: b09166dde7931054f168514e503ebdef87067902177721bb5377dec8f89aa7fa
3
+ metadata.gz: 9215c8da9ac6f18a5a552237e0f553b4dc055ca0fabd78821602517ebcf802c4
4
+ data.tar.gz: 382be551f40940cb23ca1983bc0040ca7f809339086988c394e4a555872f5446
5
5
  SHA512:
6
- metadata.gz: 7f62b3a8857549d506d836ef12a60530ae7f243beb80996b820b2f35009cada16c8e5ba0aaec2579aa4e6a9060f6cc314e78e03204e3e01825725eee4f0b7951
7
- data.tar.gz: 0b0bdafecbda35a3b1d453101a56a9e388c77836216f7c3db2105f32a3956105b80ad52f6c151ddce75fc5d6db05d3f77220518c431b11efeba6d900ddac38b8
6
+ metadata.gz: 9b0f002423acb683795d68040b049a2504f458bd4b4f7eee1818f85ca81c52daaf9eff09ac8a1ee3bf0af5596e9a1ef5f31c84f8ef1d2e208533d1daf581c906
7
+ data.tar.gz: 1b6ff1b9efe0ee53ca77fe433ebfbf217172a84aebd914986b25dbee6e125c9eaf3923cc43f2d0633f75acc41ca12ea58d2381ea387187d605f85b94f67907c1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [v0.10.2] - 18-03-2024
2
+ ## What's Changed
3
+ * Support shadow with by @gjtorikian in https://github.com/gjtorikian/tailwind_merge/pull/25
4
+
5
+
6
+ **Full Changelog**: https://github.com/gjtorikian/tailwind_merge/compare/v0.10.1...v0.10.2
1
7
  ## [v0.10.1] - 30-01-2024
2
8
  ## What's Changed
3
9
  * Fix stroke-color being incorrectly detected as stroke-width by @gjtorikian in https://github.com/gjtorikian/tailwind_merge/pull/24
data/README.md CHANGED
@@ -14,6 +14,8 @@ If bundler is not being used to manage dependencies, install the gem by executin
14
14
 
15
15
  $ gem install tailwind_merge
16
16
 
17
+ To use it, pass in a single string:
18
+
17
19
  ```ruby
18
20
  require "tailwind_merge"
19
21
 
@@ -21,6 +23,15 @@ TailwindMerge::Merger.new.merge("px-2 py-1 bg-red hover:bg-dark-red p-3 bg-[#B91
21
23
  # → 'hover:bg-dark-red p-3 bg-[#B91C1C]'
22
24
  ```
23
25
 
26
+ Or, an array of strings:
27
+
28
+ ```ruby
29
+ require "tailwind_merge"
30
+
31
+ TailwindMerge::Merger.new.merge(["px-2 py-1", "bg-red hover:bg-dark-red", "p-3 bg-[#B91C1C]"])
32
+ # → 'hover:bg-dark-red p-3 bg-[#B91C1C]'
33
+ ```
34
+
24
35
  ## What's it for?
25
36
 
26
37
  If you use Tailwind with a component-based UI renderer (like [ViewComponent](https://viewcomponent.org) or [Ariadne](https://github.com/yettoapp/ariadne)), you're probably familiar with the situation that you want to change some styles of an existing component:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TailwindMerge
4
- VERSION = "0.10.2"
4
+ VERSION = "0.11.0"
5
5
  end
@@ -35,6 +35,10 @@ module TailwindMerge
35
35
  end
36
36
 
37
37
  def merge(classes)
38
+ if classes.is_a?(Array)
39
+ classes = classes.compact.join(" ")
40
+ end
41
+
38
42
  @cache.getset(classes) do
39
43
  merge_class_list(classes)
40
44
  end
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.10.2
4
+ version: 0.11.0
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: 2024-03-18 00:00:00.000000000 Z
11
+ date: 2024-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lru_redux