blob: 984389be6c9a5cb3238dd9c60a0b564699b9455d (
plain) (
blame)
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
|
import type { HTMLAttributes } from "corvos/plugins/jsx.ts";
import site from "@/corvos.config.ts";
export type Props = HTMLAttributes<"a"> & {
size?: "sm" | "lg";
variant?: "static-black" | "static-white";
};
export const Logo = async ({ size, variant, class: cls, ...props }: Props) => {
const symbols = await site.load("assets/symbols.svg").one();
return (
<a
aria-label="Home"
class:list={[
"c-logo",
{
[`c-logo--${size}`]: size,
[`c-logo--${variant}`]: variant,
},
cls,
]}
href={site.$.url()}
rel="home"
{...props}
>
<svg class="c-logo__img">
<title>Logo</title>
<use href={`${symbols.url}#logo${size === "sm" ? "-sm" : ""}`} />
</svg>
</a>
);
};
|