tailwind_merge 0.12.2 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +12 -1
- data/lib/tailwind_merge/config.rb +7 -4
- data/lib/tailwind_merge/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: 963bec3ea5a28c6f2e282b5836fd2b1bb317aafee92a6c65872b1b52919bca3a
|
4
|
+
data.tar.gz: 8b86c7e251064a52b8a591933bb09dcdf5e72efba0edc508066d0bcbf3bf3cfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f980fb0cb733e00de99e109fa12c36a125af360f62ee471ec49da0c2aaa4d57590dcd2957cb3531ab4ebb25bf197ca8e3ccd85b679c140e0dcecb5b38b96324d
|
7
|
+
data.tar.gz: 7327cef609f7617f99196d2ef8dd2f98190e7eaf90dc7af0305b5eb4062bc3c8887b5653ce13be427602b9665671745c788a57fa8fa4b1775253b4784ed7bbee
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# [v0.13.0] - 29-08-2024
|
2
|
+
## What's Changed
|
3
|
+
* Add theme support by @gjtorikian in https://github.com/gjtorikian/tailwind_merge/pull/32
|
4
|
+
|
5
|
+
|
6
|
+
**Full Changelog**: https://github.com/gjtorikian/tailwind_merge/compare/v0.12.2...v0.13.0
|
1
7
|
# [v0.12.2] - 18-08-2024
|
2
8
|
## What's Changed
|
3
9
|
* remove spurious debug statement by @gjtorikian in https://github.com/gjtorikian/tailwind_merge/pull/28
|
data/README.md
CHANGED
@@ -310,7 +310,18 @@ In the Tailwind config you can modify theme scales. `tailwind_merge` follows the
|
|
310
310
|
- `space`
|
311
311
|
- `translate`
|
312
312
|
|
313
|
-
If you modified one of these theme scales in your Tailwind config, you can add all your keys right here and tailwind-merge will take care of the rest.
|
313
|
+
If you modified one of these theme scales in your Tailwind config, you can add all your keys right here and tailwind-merge will take care of the rest. For example, to add custom spaces and margin, you would provide the following `theme`:
|
314
|
+
|
315
|
+
```ruby
|
316
|
+
merger = TailwindMerge::Merger.new(config: {
|
317
|
+
theme: {
|
318
|
+
"spacing" => ["my-space"],
|
319
|
+
"margin" => ["my-margin"],
|
320
|
+
},
|
321
|
+
})
|
322
|
+
```
|
323
|
+
|
324
|
+
If you modified other theme scales, you need to figure out the class group to modify in the [default config](#getdefaultconfig).
|
314
325
|
|
315
326
|
### Validators
|
316
327
|
|
@@ -4,8 +4,8 @@ module TailwindMerge
|
|
4
4
|
module Config
|
5
5
|
include Validators
|
6
6
|
|
7
|
-
FROM_THEME = ->(config,
|
8
|
-
config
|
7
|
+
FROM_THEME = ->(config, key) {
|
8
|
+
config[:theme].fetch(key, nil)
|
9
9
|
}
|
10
10
|
|
11
11
|
COLORS = ->(config) { FROM_THEME.call(config, "colors") }
|
@@ -1840,10 +1840,13 @@ module TailwindMerge
|
|
1840
1840
|
def merge_configs(extension_config)
|
1841
1841
|
config = TailwindMerge::Config::DEFAULTS
|
1842
1842
|
[:theme].each do |type|
|
1843
|
-
extension_config.fetch(type, {}).each_pair do |key,
|
1844
|
-
config[type][
|
1843
|
+
extension_config.fetch(type, {}).each_pair do |key, scales|
|
1844
|
+
config[type][key] << ->(klass) {
|
1845
|
+
scales.include?(klass)
|
1846
|
+
}
|
1845
1847
|
end
|
1846
1848
|
end
|
1849
|
+
|
1847
1850
|
config
|
1848
1851
|
end
|
1849
1852
|
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.
|
4
|
+
version: 0.13.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-08-
|
11
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lru_redux
|