Skip to content

Commit a1b5d1a

Browse files
author
Suliman Benhalim
committed
fix: button hover state persisting on mobile screen. closes: saadeghi#3817
1 parent 110cfee commit a1b5d1a

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

packages/daisyui/src/components/button.css

+55
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,24 @@
187187
--btn-border: var(--btn-color);
188188
--btn-noise: none;
189189
}
190+
191+
@media (hover: none) {
192+
&:hover:not(
193+
.btn-active,
194+
:active,
195+
:focus-visible,
196+
:disabled,
197+
[disabled],
198+
.btn-disabled,
199+
:checked
200+
) {
201+
--btn-shadow: "";
202+
--btn-bg: #0000;
203+
--btn-fg: var(--btn-color);
204+
--btn-border: var(--btn-color);
205+
--btn-noise: none;
206+
}
207+
}
190208
}
191209

192210
.btn-dash {
@@ -207,6 +225,25 @@
207225
--btn-border: var(--btn-color);
208226
--btn-noise: none;
209227
}
228+
229+
@media (hover: none) {
230+
&:hover:not(
231+
.btn-active,
232+
:active,
233+
:focus-visible,
234+
:disabled,
235+
[disabled],
236+
.btn-disabled,
237+
:checked
238+
) {
239+
--btn-shadow: "";
240+
border-style: dashed;
241+
--btn-bg: #0000;
242+
--btn-fg: var(--btn-color);
243+
--btn-border: var(--btn-color);
244+
--btn-noise: none;
245+
}
246+
}
210247
}
211248

212249
.btn-soft {
@@ -225,6 +262,24 @@
225262
);
226263
--btn-noise: none;
227264
}
265+
266+
@media (hover: none) {
267+
&:hover:not(.btn-active, :active, :focus-visible, :disabled, [disabled], .btn-disabled) {
268+
--btn-shadow: "";
269+
--btn-fg: var(--btn-color, var(--color-base-content));
270+
--btn-bg: color-mix(
271+
in oklab,
272+
var(--btn-color, var(--color-base-content)) 8%,
273+
var(--color-base-100)
274+
);
275+
--btn-border: color-mix(
276+
in oklab,
277+
var(--btn-color, var(--color-base-content)) 10%,
278+
var(--color-base-100)
279+
);
280+
--btn-noise: none;
281+
}
282+
}
228283
}
229284

230285
.btn-xs {

0 commit comments

Comments
 (0)