-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgropdown-entry.templ
59 lines (56 loc) · 1.29 KB
/
gropdown-entry.templ
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
package gropdown
templ entry(item DropdownItem) {
<li role="none">
if item.Href != "" {
<a
role="menuitem"
class={ gddLI_Item() }
href={ templ.SafeURL(item.Href) }
if item.External {
data-external="true"
}
{ item.Attrs... }
>
if item.Icon != "" {
<div class={ gddLI_ItemIcon() }>
@templ.Raw(item.Icon)
</div>
}
{ item.Label }
</a>
} else {
<button role="menuitem" class={ gddLI_Item() } { item.Attrs... }>
if item.Icon != "" {
<div class={ gddLI_ItemIcon() }>
@templ.Raw(item.Icon)
</div>
}
{ item.Label }
</button>
}
</li>
}
css gddLI_Item() {
position: relative;
display: flex;
width: 100%;
text-decoration: none;
gap: var(--gdd-item-icon-space);
padding: var(--gdd-item-py) var(--gdd-item-px);
color: var(--gdd-item-color);
font-size: var(--gdd-item-font-size);
line-height: var(--gdd-item-line-height);
letter-spacing: var(--gdd-item-letter-spacing);
background-color: var(--gdd-item-bg-color);
border-width: var(--gdd-item-border-width);
border-style: var(--gdd-item-border-style);
border-color: var(--gdd-item-border-color);
border-radius: var(--gdd-item-border-radius);
}
css gddLI_ItemIcon() {
display: inline-flex;
align-items: center;
flex-shrink: 0;
width: 1.25em;
height: 1.25em;
}