tailwind_merge 0.12.2 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bd029b3106698874b67142336e597f9369c92664531879ad22eedd0cba6645b
4
- data.tar.gz: 5389d8adf19d10d5f4edd08bff8cfd94f23e8ce65f6893400b0a8416de629faa
3
+ metadata.gz: 3d9510eb868ab28e1293dd1e1ff8d4beab6753b4ce2d6be928df305293b61fbe
4
+ data.tar.gz: e7c146b9e58a58e5cef2a5826cf3a88b01ee7722326a8c778dccfc7c820cb75a
5
5
  SHA512:
6
- metadata.gz: 2236d20be8ac16e9fb1ee61682c00d8cc00a8102a1f12ef6ab2d56bd9829a041feb08e5448ebcf09e7940a43b3d6ca512ce0f381bdd006275302167c245700b1
7
- data.tar.gz: aa34f52e7f697c8b1c01d3bead20a4868393f054dfbf9dbb7595d842d3883c26c23e1039dc6b14cd309671b198f6751181465478f246f5b609acf628694de861
6
+ metadata.gz: acbefd880e9a661e85cbc2effc55675f13472b02b54d4d434b3baa80139473145ca7ac01bb2c666b9e3cdef9c58f8ba1c5ee8fe3254a5a57931efecf860081c7
7
+ data.tar.gz: 2988a83311e3a6779e9b91a350f2245a5d2c0a4f721170455962575223fe3ac53a46a62a45f7301b265e36cbce2f5ebe705fd96dceb7d71d27826eed62491bc8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [v0.13.1] - 03-10-2024
2
+ ## What's Changed
3
+ * Add missing logical border color properties by @gjtorikian in https://github.com/gjtorikian/tailwind_merge/pull/34
4
+
5
+
6
+ **Full Changelog**: https://github.com/gjtorikian/tailwind_merge/compare/v0.13.0...v0.13.1
7
+ # [v0.13.0] - 29-08-2024
8
+ ## What's Changed
9
+ * Add theme support by @gjtorikian in https://github.com/gjtorikian/tailwind_merge/pull/32
10
+
11
+
12
+ **Full Changelog**: https://github.com/gjtorikian/tailwind_merge/compare/v0.12.2...v0.13.0
1
13
  # [v0.12.2] - 18-08-2024
2
14
  ## What's Changed
3
15
  * 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. If you modified other theme scales, you need to figure out the class group to modify in the [default config](#getdefaultconfig).
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, theme) {
8
- config.fetch(:theme, {}).fetch(theme, nil)
7
+ FROM_THEME = ->(config, key) {
8
+ config[:theme].fetch(key, nil)
9
9
  }
10
10
 
11
11
  COLORS = ->(config) { FROM_THEME.call(config, "colors") }
@@ -1134,6 +1134,16 @@ module TailwindMerge
1134
1134
  ##
1135
1135
  "border-color-y" => [{ "border-y" => [BORDER_COLOR] }],
1136
1136
  ##
1137
+ # Border Color S
1138
+ # @see https://tailwindcss.com/docs/border-color
1139
+ ##
1140
+ "border-color-s" => [{ "border-s" => [BORDER_COLOR] }],
1141
+ ##
1142
+ # Border Color E
1143
+ # @see https://tailwindcss.com/docs/border-color
1144
+ ##
1145
+ "border-color-e" => [{ "border-e" => [BORDER_COLOR] }],
1146
+ ##
1137
1147
  # Border Color Top
1138
1148
  # @see https://tailwindcss.com/docs/border-color
1139
1149
  ##
@@ -1796,6 +1806,8 @@ module TailwindMerge
1796
1806
  "border-w-x" => ["border-w-r", "border-w-l"],
1797
1807
  "border-w-y" => ["border-w-t", "border-w-b"],
1798
1808
  "border-color" => [
1809
+ "border-color-s",
1810
+ "border-color-e",
1799
1811
  "border-color-t",
1800
1812
  "border-color-r",
1801
1813
  "border-color-b",
@@ -1840,10 +1852,13 @@ module TailwindMerge
1840
1852
  def merge_configs(extension_config)
1841
1853
  config = TailwindMerge::Config::DEFAULTS
1842
1854
  [:theme].each do |type|
1843
- extension_config.fetch(type, {}).each_pair do |key, value|
1844
- config[type][value] = ->(config) { FROM_THEME.call(config, key) }
1855
+ extension_config.fetch(type, {}).each_pair do |key, scales|
1856
+ config[type][key] << ->(klass) {
1857
+ scales.include?(klass)
1858
+ }
1845
1859
  end
1846
1860
  end
1861
+
1847
1862
  config
1848
1863
  end
1849
1864
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TailwindMerge
4
- VERSION = "0.12.2"
4
+ VERSION = "0.13.1"
5
5
  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.12.2
4
+ version: 0.13.1
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-18 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lru_redux