Skip to content

Commit 6cb4500

Browse files
authored
fix: adjust layers - drawer and collapse (#4183)
* move parts from card, carouse, and chat from modifier to component layer * docs: remove a high z-index from drawer example * move collapse open status classes to modifier layer to allow animating status icons * move drawer-end class in modifier.placement layer for lower priority
1 parent 49507d4 commit 6cb4500

6 files changed

Lines changed: 21 additions & 19 deletions

File tree

packages/daisyui/src/components/card.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@
7979
}
8080

8181
.card-title {
82-
@layer daisyui.modifier {
82+
@layer daisyui.component {
8383
@apply flex items-center gap-2;
8484
font-size: var(--cardtitle-fs, 1.125rem);
8585
font-weight: 600;
8686
}
8787
}
8888

8989
.card-body {
90-
@layer daisyui.modifier {
90+
@layer daisyui.component {
9191
@apply flex flex-auto flex-col gap-2;
9292
padding: var(--card-p, 1.5rem);
9393
font-size: var(--card-fs, 0.875rem);
@@ -99,7 +99,7 @@
9999
}
100100

101101
.card-actions {
102-
@layer daisyui.modifier {
102+
@layer daisyui.component {
103103
@apply flex flex-wrap items-start gap-2;
104104
}
105105
}

packages/daisyui/src/components/carousel.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929

3030
.carousel-item {
31-
@layer daisyui.modifier {
31+
@layer daisyui.component {
3232
@apply box-content flex flex-none;
3333
scroll-snap-align: start;
3434
}

packages/daisyui/src/components/chat.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,20 @@
7575
}
7676

7777
.chat-image {
78-
@layer daisyui.modifier {
78+
@layer daisyui.component {
7979
@apply row-span-2 self-end;
8080
}
8181
}
8282

8383
.chat-header {
84-
@layer daisyui.modifier {
84+
@layer daisyui.component {
8585
@apply row-start-1 flex gap-1;
8686
font-size: 0.6875rem;
8787
}
8888
}
8989

9090
.chat-footer {
91-
@layer daisyui.modifier {
91+
@layer daisyui.component {
9292
@apply row-start-3 flex gap-1;
9393
font-size: 0.6875rem;
9494
}

packages/daisyui/src/components/collapse.css

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@
8383
}
8484
}
8585

86+
> input:is([type="checkbox"], [type="radio"]) {
87+
z-index: 1;
88+
width: 100%;
89+
padding: 1rem;
90+
padding-inline-end: 3rem;
91+
min-height: 1lh;
92+
transition: background-color 0.2s ease-out;
93+
}
94+
}
95+
96+
@layer daisyui.modifier {
8697
&:is([open]) {
8798
&.collapse-arrow {
8899
> .collapse-title:after {
@@ -143,15 +154,6 @@
143154
content: "−";
144155
}
145156
}
146-
147-
> input:is([type="checkbox"], [type="radio"]) {
148-
z-index: 1;
149-
width: 100%;
150-
padding: 1rem;
151-
padding-inline-end: 3rem;
152-
min-height: 1lh;
153-
transition: background-color 0.2s ease-out;
154-
}
155157
}
156158
}
157159

packages/daisyui/src/components/drawer.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
}
7373

7474
.drawer-end {
75-
@layer daisyui.modifier {
75+
@layer daisyui.modifier.placement {
7676
grid-auto-columns: auto max-content;
7777

7878
> .drawer-toggle {

packages/docs/src/routes/(routes)/components/drawer/+page.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ You can check/uncheck the checkbox using JavaScript or by clicking the `label` t
223223
<div class="h-56 drawer-content">
224224
<!-- Page content here -->
225225
</div>
226-
<div class="drawer-side is-drawer-close:overflow-visible h-full max-lg:z-1002">
226+
<div class="drawer-side is-drawer-close:overflow-visible h-full">
227227
<label for="my-drawer-4" aria-label="close sidebar" class="drawer-overlay"></label>
228228
<div class="is-drawer-close:w-14 is-drawer-open:w-64 h-full bg-base-200 flex flex-col items-start">
229229
<ul class="menu w-full grow">
@@ -267,7 +267,7 @@ You can check/uncheck the checkbox using JavaScript or by clicking the `label` t
267267
<div class="$$drawer-content">
268268
<!-- Page content here -->
269269
</div>
270-
270+
271271
<div class="$$drawer-side is-drawer-close:overflow-visible">
272272
<label for="my-drawer-4" aria-label="close sidebar" class="$$drawer-overlay"></label>
273273
<div class="is-drawer-close:w-14 is-drawer-open:w-64 bg-base-200 flex flex-col items-start min-h-full">

0 commit comments

Comments
 (0)