daisyui 2.2.1 → 2.2.2
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 +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +7 -1
- data/lib/daisy_ui/class_merge/daisy_groups.rb +18 -3
- data/lib/daisy_ui/updated_at.rb +1 -1
- data/lib/daisy_ui/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a83f4b0512262bb7ae533a4c76e09badf6a1f6d9504429dc6cc3febbf163d034
|
|
4
|
+
data.tar.gz: 86bc9c1f0751a6fd58dd64c172202c2d0f87cc7af7f95d46d7a9c8c8dd888d26
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1c0df513bd19ed59577cc986f6f10ae48c4c3269097e58077c75addcfa3714296e00347232a044b838e69a98c8c02b0f03a5b7e7a8216a1ef92629292b0b95a
|
|
7
|
+
data.tar.gz: f8ee5ef84355d080506310783167fb64cf19d4c9875eb5082862b2d2240f79575a1cc84c685ff6cd8630f192a8d75a8d3ac65ca49ef8cf0c20d4a176669c9cd7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [2.2.2] - 2026-10-27
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- A variant member's classes no longer knock each other out. A group now holds
|
|
8
|
+
only the component's own `<component_class>-*` classes; a member's other
|
|
9
|
+
classes Tailwind does not classify (plugin utilities such as
|
|
10
|
+
`motion-opacity-in-0 motion-duration-[400ms]`) are ungrouped, as a flag's
|
|
11
|
+
are, so all of them render. A component without a `component_class` groups
|
|
12
|
+
none of its own classes; globally configured grouped modifiers are unchanged
|
|
13
|
+
(#73).
|
|
14
|
+
|
|
15
|
+
## [2.2.1] - 2026-10-27
|
|
16
|
+
|
|
3
17
|
### Fixed
|
|
4
18
|
|
|
5
19
|
- The Tailwind sources generator accepts named groups and peers
|
data/README.md
CHANGED
|
@@ -269,6 +269,12 @@ dependency). daisyUI modifiers conflict when the component declares them as
|
|
|
269
269
|
alternatives in one group: `btn-sm btn-lg` keeps `btn-lg`, while
|
|
270
270
|
`dropdown-top dropdown-end` keeps both (placement and alignment are separate
|
|
271
271
|
groups). Ungrouped modifiers (`btn-wide`, `btn-active`) never conflict.
|
|
272
|
+
A group holds only the component's own `<component_class>-*` classes: a
|
|
273
|
+
member's Tailwind utilities resolve by Tailwind's groups, and any other class
|
|
274
|
+
in it (a plugin utility such as `motion-duration-[400ms]`) never conflicts, so
|
|
275
|
+
the classes of one member never knock each other out. To make such classes
|
|
276
|
+
alternatives, set the component's `component_class` and name them
|
|
277
|
+
`<component_class>-*`, or register them with `class_groups` (below).
|
|
272
278
|
Component base classes such as `table` and `collapse` are never dropped.
|
|
273
279
|
|
|
274
280
|
Register custom utilities so the merger knows what they are. Unregistered,
|
|
@@ -382,7 +388,7 @@ Widget(:ghost, :sm) # btn font-medium btn-ghost btn-sm [--fontsize:…] [--btn-b
|
|
|
382
388
|
|
|
383
389
|
| Declaration | |
|
|
384
390
|
|---|---|
|
|
385
|
-
| `variant :group, member: "classes", …` | Alternatives: the grouped `register_modifiers(group: { … })`. Members merge as one ClassMerge group. |
|
|
391
|
+
| `variant :group, member: "classes", …` | Alternatives: the grouped `register_modifiers(group: { … })`. Members' own `<component_class>-*` classes merge as one ClassMerge group. |
|
|
386
392
|
| `flag :name, "classes"` | An on/off modifier: an ungrouped `register_modifiers` entry. `flag :name` alone is a `register_flags` flag, no class, for compounds to match. |
|
|
387
393
|
| `base "classes"` | Classes every instance gets, appended to the inherited base. |
|
|
388
394
|
| `default :group, :member` | The member used when the caller names none of the group. Never rendered beside a member the caller gives. |
|
|
@@ -8,8 +8,14 @@ module DaisyUI
|
|
|
8
8
|
#
|
|
9
9
|
# gives the group `daisy:group:btn-size` = ["btn-sm", "btn-lg"], so
|
|
10
10
|
# `btn-sm btn-lg` merges to `btn-lg`. Ungrouped modifiers never conflict.
|
|
11
|
+
#
|
|
12
|
+
# A group holds only the component's own `<component_class>-*` classes.
|
|
11
13
|
# Tokens Tailwind already classifies (`bg-primary text-primary-content`)
|
|
12
|
-
# are left to the Tailwind groups, which resolve them per utility.
|
|
14
|
+
# are left to the Tailwind groups, which resolve them per utility. Any
|
|
15
|
+
# other class (a plugin utility such as `motion-duration-[400ms]`) is left
|
|
16
|
+
# ungrouped, as a flag is: a group would make the classes of one member
|
|
17
|
+
# knock each other out. A component without a component_class groups
|
|
18
|
+
# nothing of its own.
|
|
13
19
|
#
|
|
14
20
|
# Every gem component base class (`btn`, `table`) also gets a group of its
|
|
15
21
|
# own and is never dropped, even where Tailwind has a utility of the same
|
|
@@ -33,14 +39,16 @@ module DaisyUI
|
|
|
33
39
|
components.each do |component|
|
|
34
40
|
component.modifier_groups.each do |group, members|
|
|
35
41
|
tokens = members.flat_map { |member| component.modifiers[member].to_s.split }
|
|
36
|
-
add(groups, "daisy:group:#{component.component_class || component.name}-#{group}", tokens, prefix)
|
|
42
|
+
add(groups, "daisy:group:#{component.component_class || component.name}-#{group}", own(tokens, component), prefix)
|
|
37
43
|
end
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
# Configured modifiers join the component's own group of that name.
|
|
47
|
+
# A global one has no component to own its classes: all are grouped.
|
|
41
48
|
configuration.modifiers.groups.each do |(component, group), classes|
|
|
42
49
|
owner = component ? component.component_class || component.name : "global"
|
|
43
|
-
|
|
50
|
+
tokens = classes.flat_map(&:split)
|
|
51
|
+
add(groups, "daisy:group:#{owner}-#{group}", component ? own(tokens, component) : tokens, prefix)
|
|
44
52
|
end
|
|
45
53
|
|
|
46
54
|
groups
|
|
@@ -68,6 +76,13 @@ module DaisyUI
|
|
|
68
76
|
|
|
69
77
|
private
|
|
70
78
|
|
|
79
|
+
# The component's own modifier classes: `btn-sm` for `btn`.
|
|
80
|
+
def own(tokens, component)
|
|
81
|
+
return [] unless (base = component.component_class)
|
|
82
|
+
|
|
83
|
+
tokens.select { |token| token.start_with?("#{base}-") }
|
|
84
|
+
end
|
|
85
|
+
|
|
71
86
|
# Subclasses share their parent's component_class and group names, so
|
|
72
87
|
# their tokens land in the same group id and are unioned.
|
|
73
88
|
def add(groups, id, tokens, prefix)
|
data/lib/daisy_ui/updated_at.rb
CHANGED
data/lib/daisy_ui/version.rb
CHANGED