forked from saadeghi/daisyui
/
menu.css
132 lines (125 loc) · 3.52 KB
/
menu.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
.menu {
&.horizontal {
li {
&.bordered {
> a,
> button,
> span {
@apply border-l-0 border-b-4 border-primary;
}
}
}
}
&[class*=" px-"]:not(&[class*=" px-0"]) li > *,
&[class^="px-"]:not(&[class^="px-0"]) li > *,
&[class*=" p-"]:not(&[class*=" p-0"]) li > *,
&[class^="p-"]:not(&[class^="p-0"]) li > * {
@apply rounded-btn;
}
:where(li.bordered > *) {
@apply border-l-4 border-primary;
}
:where(li) > :where(*:not(ul)) {
@apply gap-3 px-4 py-3 text-current;
}
:where(li:not(.menu-title):not(:empty)) > :where(*:not(ul):focus),
:where(li:not(.menu-title):not(:empty)) > :where(*:not(ul):hover) {
@apply bg-base-content bg-opacity-10;
}
:where(li:not(.menu-title):not(:empty)) > :where(:not(ul).active),
:where(li:not(.menu-title):not(:empty)) > :where(*:not(ul):active) {
@apply bg-primary text-primary-content;
}
:where(li:empty) {
@apply mx-4 my-2 h-px bg-base-content bg-opacity-10;
}
li.disabled {
& > * {
@apply select-none text-base-content text-opacity-20 hover:bg-transparent;
}
}
li.hover-bordered {
a {
@apply border-l-4 border-transparent hover:border-primary;
}
}
&.compact {
li {
> a,
> span {
@apply py-2 text-sm;
}
}
}
.menu-title {
> * {
@apply py-1 text-xs font-bold text-base-content text-opacity-40;
}
}
}
.menu :where(li:not(.disabled)) > :where(*:not(ul)) {
@apply outline-none transition duration-200 ease-in-out;
}
.menu > :where(li:first-child) {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
border-bottom-right-radius: unset;
border-bottom-left-radius: unset;
}
.menu > :where(li:first-child) > :where(:not(ul)) {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
border-bottom-right-radius: unset;
border-bottom-left-radius: unset;
}
.menu > :where(li:last-child) {
border-top-left-radius: unset;
border-top-right-radius: unset;
border-bottom-right-radius: inherit;
border-bottom-left-radius: inherit;
}
.menu > :where(li:last-child) > :where(:not(ul)) {
border-top-left-radius: unset;
border-top-right-radius: unset;
border-bottom-right-radius: inherit;
border-bottom-left-radius: inherit;
}
.menu > :where(li) > :where(ul) {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
border-bottom-right-radius: inherit;
border-bottom-left-radius: inherit;
}
.menu > :where(li) > :where(ul) :where(li) {
@apply w-full whitespace-nowrap;
}
.menu > :where(li) > :where(ul) :where(li) :where(ul) {
@apply pl-4;
}
.menu > :where(li) > :where(ul) :where(li) > :where(:not(ul)) {
@apply w-full whitespace-nowrap;
}
.menu > :where(li) > :where(ul) > :where(li:first-child) {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
border-bottom-right-radius: unset;
border-bottom-left-radius: unset;
}
.menu > :where(li) > :where(ul) > :where(li:first-child) > :where(:not(ul)) {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
border-bottom-right-radius: unset;
border-bottom-left-radius: unset;
}
.menu > :where(li) > :where(ul) > :where(li:last-child) {
border-top-left-radius: unset;
border-top-right-radius: unset;
border-bottom-right-radius: inherit;
border-bottom-left-radius: inherit;
}
.menu > :where(li) > :where(ul) > :where(li:last-child) > :where(:not(ul)) {
border-top-left-radius: unset;
border-top-right-radius: unset;
border-bottom-right-radius: inherit;
border-bottom-left-radius: inherit;
}