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 +4 -4
- data/lib/vident/tailwind/version.rb +1 -1
- data/lib/vident/tailwind.rb +11 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b6e849454d232820979000bfb2bd9ef123690081b174d5cda421804646a7427
|
4
|
+
data.tar.gz: fd213fa9f3d82fc31f738cd7e23534b5d22424c2b95ddd0e7e8b7be5c2ea94cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b9cadbdc8e57d6e0c79d1e118de00c1be6ab6b7384bfbb54af1263125ac25ff3ee395b471250b06c7b219f0bda32c836c38774e328553a04e4fa36c6e70eb1e
|
7
|
+
data.tar.gz: 1200e10b897bdbde3354b5cde3fd0ef005b74ef928c231821b11583278ec749dd5ea86a012d63cb6980240163fe541c87cffb35103067e21ba7d42a6417e5c4d
|
data/lib/vident/tailwind.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
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.
|
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
|