mirror of
https://github.com/priyanshujain/margin.git
synced 2026-10-03 03:27:03 +00:00
changes
This commit is contained in:
1 parent
bd44c0ba7e
commit
706db33792
65 files changed
+6844
-1
No files matched your search
@@ -0,0 +1,31 @@
|
||||
---
|
||||
const icons = import.meta.glob("../icons/*.svg", {
|
||||
query: "?raw",
|
||||
import: "default",
|
||||
eager: true,
|
||||
});
|
||||
|
||||
interface Props {
|
||||
name: string;
|
||||
label?: string;
|
||||
class?: string;
|
||||
}
|
||||
const { name, label, class: cls } = Astro.props;
|
||||
const svg = (icons[`../icons/${name}.svg`] as string | undefined) ?? "";
|
||||
---
|
||||
|
||||
<span class:list={["brand-icon", cls]} role="img" aria-label={label} set:html={svg}></span>
|
||||
|
||||
<style is:global>
|
||||
.brand-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 0;
|
||||
}
|
||||
.brand-icon svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
fill: currentColor;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user