Skip to content

Commit 91fd78f

Browse files
authored
Merge pull request #1270 from acmcsufoss/fix/863
fix: Footer icons lacking hover effect
2 parents dd85f2a + e35ffcd commit 91fd78f

2 files changed

Lines changed: 35 additions & 21 deletions

File tree

src/lib/components/footer/footer.svelte

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script lang="ts">
2-
import BwIcon from '$lib/components/bw-icon/bw-icon.svelte';
3-
import { AcmTheme } from '$lib/public/legacy/theme';
2+
import SocialIcon from '$lib/components/social-icon/social-icon.svelte';
43
54
const footerItems = [
65
{ title: 'Source Code', path: '/code' },
@@ -21,11 +20,7 @@
2120
{#each socials as socialPath (socialPath)}
2221
<li>
2322
<a href={socialPath} target="_blank" rel="noopener noreferrer">
24-
<BwIcon
25-
src={`/assets${socialPath}.svg`}
26-
alt={socialPath.slice(1)}
27-
filterOn={[AcmTheme.Dark, AcmTheme.Light]}
28-
/>
23+
<SocialIcon src={`/assets${socialPath}.svg`} alt={socialPath.slice(1)} width={24} />
2924
</a>
3025
</li>
3126
{/each}
@@ -107,28 +102,17 @@
107102
108103
.socials {
109104
display: flex;
105+
padding-top: 6px;
110106
gap: 32px;
111107
112108
a {
113109
display: flex;
114-
padding-top: 6px;
110+
--icon-color: #ffffff;
115111
116112
&:hover {
117-
& :global(path) {
118-
fill: var(--acm-blue);
119-
}
113+
--icon-color: var(--acm-blue);
120114
}
121115
}
122-
123-
& :global(svg) {
124-
height: 32px;
125-
width: auto;
126-
}
127-
128-
& :global(path) {
129-
fill: var(--perma-light);
130-
transition: 0.25s ease-in-out;
131-
}
132116
}
133117
}
134118
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<script lang="ts">
2+
export let src: string;
3+
export let alt: string;
4+
export let width = 32;
5+
export let height = width;
6+
</script>
7+
8+
<div
9+
role="img"
10+
aria-label={alt}
11+
class="social-icon"
12+
style:--icon-url="url({src})"
13+
style:--size-w="{width}px"
14+
style:--size-h="{height}px"
15+
></div>
16+
17+
<style lang="scss">
18+
.social-icon {
19+
width: var(--size-w);
20+
height: var(--size-h);
21+
display: inline-block;
22+
23+
mask: var(--icon-url) no-repeat center / contain;
24+
-webkit-mask: var(--icon-url) no-repeat center / contain;
25+
26+
background-color: var(--icon-color, #ffffff);
27+
28+
transition: background-color 0.25s ease-in-out;
29+
}
30+
</style>

0 commit comments

Comments
 (0)