vident-tailwind 0.1.1 → 0.2.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: 65a6a46cc228c6dcda2ad7d0c66b790e363e17d0ff5eed962461f681f754da1b
4
- data.tar.gz: 2d2a772f270d1b80a3313b9cb0a285d97709f0751162a91407e23a772f4cffbd
3
+ metadata.gz: 8b6e849454d232820979000bfb2bd9ef123690081b174d5cda421804646a7427
4
+ data.tar.gz: fd213fa9f3d82fc31f738cd7e23534b5d22424c2b95ddd0e7e8b7be5c2ea94cd
5
5
  SHA512:
6
- metadata.gz: 3cb834a48f22572adb0113a44e2e8ea02d8522c76592f2a0dc18348b372fbe32e1b89898e68ce849850e085b861567ad62e899e3a78eb1cddc818c5c94dcb0ce
7
- data.tar.gz: 13719fdafacf17f6bc8d907ec5528ccf049ccaec7f33d00b6f54505c87d7a8fdae4dadef5005a422edaf72f9cbe8f450dfc8cf0e963509b4ac4e2af752c7426d
6
+ metadata.gz: 6b9cadbdc8e57d6e0c79d1e118de00c1be6ab6b7384bfbb54af1263125ac25ff3ee395b471250b06c7b219f0bda32c836c38774e328553a04e4fa36c6e70eb1e
7
+ data.tar.gz: 1200e10b897bdbde3354b5cde3fd0ef005b74ef928c231821b11583278ec749dd5ea86a012d63cb6980240163fe541c87cffb35103067e21ba7d42a6417e5c4d
@@ -1,5 +1,5 @@
1
1
  module Vident
2
2
  module Tailwind
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -4,12 +4,20 @@ require "vident/tailwind/railtie"
4
4
  require "tailwind_merge"
5
5
 
6
6
  module Vident
7
+ # Adds a utility class merge specifically for Tailwind, allowing you to more easily specify class overrides
8
+ # without having to worry about the specificity of the classes.
7
9
  module Tailwind
8
- # Adds a utility class merge specifically for Tailwind, allowing you to more easily specify class overrides
9
- # without having to worry about the specificity of the classes.
10
10
  def produce_style_classes(class_names)
11
11
  to_merge = dedupe_view_component_classes(class_names)
12
- ::TailwindMerge::Merger.new.merge(to_merge) if to_merge.present?
12
+ tailwind_class_merger.merge(to_merge) if to_merge.present?
13
+ end
14
+
15
+ private
16
+
17
+ # If needed this can be overridden in your component to provide options for the merger.
18
+ def tailwind_class_merger
19
+ return @tailwind_class_merger if defined? @tailwind_class_merger
20
+ @tailwind_class_merger= (Thread.current[:tailwind_class_merger] ||= ::TailwindMerge::Merger.new)
13
21
  end
14
22
  end
15
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vident-tailwind
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Ierodiaconou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-02 00:00:00.000000000 Z
11
+ date: 2023-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubygems_version: 3.4.6
107
+ rubygems_version: 3.4.10
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Vident with Tailwind class deduplication to allow easy overriding