Skip to content

Commit e8082b0

Browse files
committed
Redesign icon buttons
1 parent 2d2be5a commit e8082b0

2 files changed

Lines changed: 65 additions & 11 deletions

File tree

frontend/components/DefaultHeader.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,8 @@ async function signOut() {
181181
}
182182
183183
.account-icon {
184-
width: inherit;
185-
height: inherit;
186-
opacity: 0.875;
184+
width: 100%;
185+
height: 100%;
187186
}
188187
189188
.account-menu-wrapper {

frontend/components/IconButton.vue

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,78 @@ defineProps<IconButtonProps>();
1010
</script>
1111

1212
<template>
13-
<Button class="icon-button" :title="label" :aria-label="label">
14-
<slot></slot>
15-
</Button>
13+
<button type="button" class="icon-button" :title="label" :aria-label="label">
14+
<div class="icon-glow" aria-hidden>
15+
<slot></slot>
16+
</div>
17+
<div class="icon">
18+
<slot></slot>
19+
</div>
20+
</button>
1621
</template>
1722

1823
<style lang="scss" scoped>
1924
.icon-button {
25+
vertical-align: middle;
26+
font-size: 1em;
27+
font-family: var(--font-family);
28+
color: var(--text-color);
29+
30+
position: relative;
2031
width: 2em;
2132
height: 2em;
22-
border-radius: 50%;
2333
padding: 0;
2434
25-
line-height: 0;
35+
background: none;
36+
border: none;
37+
border-radius: 0;
38+
39+
cursor: pointer;
40+
41+
opacity: 0.875;
42+
transition: 0.1s ease-out opacity;
43+
44+
&:hover:not(:disabled),
45+
&:active:not(:disabled),
46+
&:focus-visible:not(:disabled) {
47+
opacity: 1;
48+
}
49+
}
50+
51+
.icon {
52+
transition: 0.1s ease-out filter;
53+
54+
.icon-button:hover &,
55+
.icon-button:focus-visible &,
56+
.icon-button:active & {
57+
filter: brightness(1.125);
58+
}
59+
}
60+
61+
.icon-glow {
62+
position: absolute;
63+
width: 100%;
64+
pointer-events: none;
65+
66+
opacity: 0;
67+
transition:
68+
0.1s ease-out opacity,
69+
0.1s ease-out filter;
2670
27-
&:not(:hover):not(:focus-visible):not(:active) {
28-
background-color: transparent;
29-
box-shadow: none;
71+
.icon-button:hover & {
72+
opacity: 0.25;
73+
filter: blur(0.25em);
3074
}
75+
76+
.icon-button:focus-visible &,
77+
.icon-button:active & {
78+
opacity: 0.4375;
79+
filter: blur(0.2813em);
80+
transition-duration: 0.067s, 0.067s;
81+
}
82+
}
83+
84+
.icon-button :deep(svg) {
85+
vertical-align: bottom;
3186
}
3287
</style>

0 commit comments

Comments
 (0)