Skip to content

Commit c37fb9a

Browse files
committed
Use class for custom icon dimensions instead of size prop, this allows for css size overrides without !important.
1 parent daf6b89 commit c37fb9a

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/frontend/src/lib/components/icons/GoogleIcon.svelte

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
<script lang="ts">
22
import type { SVGAttributes } from "svelte/elements";
33
4-
type Props = SVGAttributes<SVGSVGElement> & {
5-
size?: string;
6-
};
7-
8-
const { size = "1.25rem", ...props }: Props = $props();
4+
const { class: className, ...props }: SVGAttributes<SVGSVGElement> = $props();
95
</script>
106

11-
<svg viewBox="0 0 20 20" width={size} height={size} {...props}>
7+
<svg viewBox="0 0 20 20" {...props} class={["size-5", className]}>
128
<path
139
d="M10 .83a9.15 9.15 0 0 0-8.18 13.28c1.5 3 4.6 5.06 8.18 5.06 2.47 0 4.55-.82 6.07-2.22a8.95 8.95 0 0 0 2.73-6.74c0-.65-.06-1.28-.17-1.88H10v3.55h4.93a4.23 4.23 0 0 1-1.84 2.76 5.47 5.47 0 0 1-8.22-2.9h-.01A5.5 5.5 0 0 1 10 4.48a5 5 0 0 1 3.5 1.37l2.63-2.63A8.8 8.8 0 0 0 10 .83Z"
1410
class="fill-current"

src/frontend/src/lib/components/icons/PasskeyIcon.svelte

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
<script lang="ts">
22
import type { SVGAttributes } from "svelte/elements";
33
4-
type Props = SVGAttributes<SVGSVGElement> & {
5-
size?: string;
6-
};
7-
8-
const { size = "1.25rem", ...props }: Props = $props();
4+
const { class: className, ...props }: SVGAttributes<SVGSVGElement> = $props();
95
</script>
106

11-
<svg viewBox="0 0 20 20" width={size} height={size} {...props}>
7+
<svg viewBox="0 0 20 20" {...props} class={["size-5", className]}>
128
<path
139
d="M9.32 1.63c-.93 0-1.8.36-2.44 1l-.02.01-.2.22-.01.02a3.4 3.4 0 0 0-.77 2.2c0 .92.35 1.8 1 2.44h.01l.22.21.02.02c.6.5 1.38.76 2.2.76.92 0 1.8-.35 2.43-1h.02l.2-.23.01-.02c.5-.6.77-1.37.77-2.19 0-.93-.35-1.8-1-2.44V2.6l-.23-.2-.02-.01a3.4 3.4 0 0 0-2.19-.77Zm6.88 6.13a3.2 3.2 0 0 0-2.27.94v.01l-.2.2-.01.02a3.17 3.17 0 0 0-.73 2.04 3.18 3.18 0 0 0 2.3 3.07v4.27l1.37 1.38 1.84-1.84-1.38-1.37 1.38-1.38-1.15-1.15a3.3 3.3 0 0 0 1.48-1.14 3.2 3.2 0 0 0-.36-4.1v-.03l-.21-.18-.02-.02a3.17 3.17 0 0 0-2.04-.72Zm0 1.83c.28 0 .47.08.66.27l.06.07c.14.17.2.34.2.58 0 .27-.08.47-.26.65l-.07.07a.86.86 0 0 1-.59.2.84.84 0 0 1-.65-.27l-.06-.07a.86.86 0 0 1-.2-.58c0-.27.08-.47.26-.65l.08-.07c.16-.13.34-.2.57-.2Zm-6.88.76c-.95 0-1.9.11-2.83.34h-.01l-.34.1h-.01c-.83.22-1.7.54-2.6.94-.45.22-.84.54-1.12.94v.01l-.09.13v.01c-.23.38-.34.84-.34 1.34v2.16H13.9v-1.36l-.36-.25a4.34 4.34 0 0 1-1.42-1.62l-.14-.3a4.47 4.47 0 0 1-.36-1.55l-.04-.69-.68-.09-.43-.05h-.01l-.55-.05H9.9l-.59-.01z"
1410
class="fill-current"

0 commit comments

Comments
 (0)