view_component-contrib 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +16 -0
- data/lib/view_component_contrib/style_variants.rb +13 -0
- data/lib/view_component_contrib/version.rb +1 -1
- 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: b586c9ad03730cff1cc38721c6904f427c71a73f5777605f17fc0379f60f8dc7
|
4
|
+
data.tar.gz: 7c2ed9aed5c845492a8487fab7ce5e66c639d455d8b4027c383b047ad961fdf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1d2f760734b6ca7f71da538fbba4c04b0ff91b885cc47e09f3943b81a5a097ef62293348dc3ac07e20a4b812e52cf8a4bd8b39b6cb306551dceac4a784c652b
|
7
|
+
data.tar.gz: baaf5f34009ca87228246f260357339849f3d22e988543f36c36e772293bede4f249741fee5749db46d37a78dd8dc94674e13181d618282463a31afd5dba48b7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -281,6 +281,22 @@ class ButtonComponent < ViewComponent::Base
|
|
281
281
|
end
|
282
282
|
```
|
283
283
|
|
284
|
+
### Using with TailwindCSS LSP
|
285
|
+
|
286
|
+
To make completions (and other LSP features) work with our DSL, try the following configuration:
|
287
|
+
|
288
|
+
```json
|
289
|
+
"tailwindCSS.includeLanguages": {
|
290
|
+
"erb": "html",
|
291
|
+
"ruby": "html"
|
292
|
+
},
|
293
|
+
"tailwindCSS.experimental.classRegex": [
|
294
|
+
"%w\\[([^\\]]*)\\]"
|
295
|
+
]
|
296
|
+
```
|
297
|
+
|
298
|
+
**NOTE:** It will only work with `%w[ ... ]` word arrays, but you can adjust it to your needs.
|
299
|
+
|
284
300
|
## Organizing assets (JS, CSS)
|
285
301
|
|
286
302
|
**NOTE**: This section assumes the usage of Vite or Webpack. See [this discussion](https://github.com/palkan/view_component-contrib/discussions/14) for other options.
|
@@ -102,6 +102,13 @@ module ViewComponentContrib
|
|
102
102
|
|
103
103
|
acc
|
104
104
|
end
|
105
|
+
|
106
|
+
def dup
|
107
|
+
copy = super
|
108
|
+
copy.instance_variable_set(:@defaults, @defaults.dup)
|
109
|
+
copy.instance_variable_set(:@variants, @variants.dup)
|
110
|
+
copy
|
111
|
+
end
|
105
112
|
end
|
106
113
|
|
107
114
|
class StyleConfig # :nodoc:
|
@@ -131,6 +138,12 @@ module ViewComponentContrib
|
|
131
138
|
@postprocessor = callable || block
|
132
139
|
end
|
133
140
|
|
141
|
+
def dup
|
142
|
+
copy = super
|
143
|
+
copy.instance_variable_set(:@styles, @styles.dup)
|
144
|
+
copy
|
145
|
+
end
|
146
|
+
|
134
147
|
private
|
135
148
|
|
136
149
|
attr_reader :styles
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component-contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: view_component
|