From 9f1061f0312e7657a095fa5fe9125a4adb53d30e Mon Sep 17 00:00:00 2001
From: lemon
Date: Sun, 22 Dec 2024 10:39:18 +0100
Subject: [PATCH 1/9] refactor(button): turn buttons into components
removing the global CSS in favour of a component
---
src/components/Button.svelte | 148 ++++++++++++++++++
src/data/icons.ts | 2 +-
src/pages/index.astro | 22 +--
.../_components/CopyToClipboardButton.svelte | 21 ++-
src/styles/_buttons.scss | 121 --------------
src/styles/global.scss | 1 -
6 files changed, 172 insertions(+), 143 deletions(-)
create mode 100644 src/components/Button.svelte
delete mode 100644 src/styles/_buttons.scss
diff --git a/src/components/Button.svelte b/src/components/Button.svelte
new file mode 100644
index 00000000..462a58b4
--- /dev/null
+++ b/src/components/Button.svelte
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/data/icons.ts b/src/data/icons.ts
index cb86083e..f62178d7 100644
--- a/src/data/icons.ts
+++ b/src/data/icons.ts
@@ -10,7 +10,7 @@ const phIcons = phIconsJson as IconifyJSONIconsData;
const DEFAULT_VIEWBOX = 16;
-const phosphorIcon = (name: string) => {
+export const phosphorIcon = (name: string) => {
const icon = phIcons.icons[name];
return {
body: icon.body,
diff --git a/src/pages/index.astro b/src/pages/index.astro
index e62f78d0..2b17980b 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,7 +1,7 @@
---
import Landing from "@layouts/Landing.astro";
+import Button from "@components/Button.svelte";
import LaptopIllustration from "./_components/LaptopIllustration.astro";
-import { Icon } from "astro-icon/components";
---
A community-driven color scheme meant for coding, designing, and much more!
diff --git a/src/pages/palette/_components/CopyToClipboardButton.svelte b/src/pages/palette/_components/CopyToClipboardButton.svelte
index 5433bafc..539f245f 100644
--- a/src/pages/palette/_components/CopyToClipboardButton.svelte
+++ b/src/pages/palette/_components/CopyToClipboardButton.svelte
@@ -29,7 +29,7 @@
};
-