From a4e28be56e5258fd320063621e01f11263b74ef3 Mon Sep 17 00:00:00 2001 From: CJ Pais Date: Mon, 12 May 2025 09:05:53 -0700 Subject: [PATCH] add reset button --- src/App.css | 49 ++++++++++++++----- src/components/icons/HandyTextLogo.tsx | 24 --------- src/components/icons/ResetIcon.tsx | 17 +++++++ src/components/settings/KeyboardShortcuts.tsx | 11 +++-- tailwind.config.js | 10 +++- 5 files changed, 68 insertions(+), 43 deletions(-) create mode 100644 src/components/icons/ResetIcon.tsx diff --git a/src/App.css b/src/App.css index 959ca4d..8ba9c84 100644 --- a/src/App.css +++ b/src/App.css @@ -1,27 +1,37 @@ @import "tailwindcss"; -/* @font-face { - src: url("/src/assets/fonts/ShortStack-Regular.ttf"); - font-family: 'Short Stack'; - font-weight: 400; - font-style: normal; - font-display: swap; -} */ +@theme { + --color-text: #0f0f0f; + --color-background: #fbfbfb; + --color-logo-primary: #FAA2CA; + --color-logo-stroke: #382731; + --color-text-stroke: #f6f6f6; + --color-mid-gray: #808080; +} :root { - /* font-family: 'Short Stack', sans-serif; */ + /* Typography */ font-size: 16px; line-height: 24px; font-weight: 400; - color: #0f0f0f; - background-color: #fbfbfb; + /* Colors - Light Theme */ + /* --color-text: #0f0f0f; + --color-background: #fbfbfb; + --color-logo-primary: #FAA2CA; + --color-logo-stroke: #382731; + --color-text-stroke: #f6f6f6; */ + /* Typography settings */ font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; + + /* Apply colors */ + color: var(--color-text); + background-color: var(--color-background); } .container { @@ -35,13 +45,26 @@ @media (prefers-color-scheme: dark) { :root { - color: #fbfbfb; - background-color: #2c2b29; + /* Colors - Dark Theme */ + --color-text: #fbfbfb; + --color-background: #2c2b29; + --color-logo-primary: #F28CBB; + --color-logo-stroke: #FAD1ED; } } @layer utilities { .text-stroke { - -webkit-text-stroke: 2px #f6f6f6; + -webkit-text-stroke: 2px var(--color-text-stroke); } +} + +.logo-primary { + fill: var(--color-logo-primary); +} + +.logo-stroke { + fill: var(--color-logo-stroke); + stroke: var(--color-logo-stroke); + stroke-width: 1; } \ No newline at end of file diff --git a/src/components/icons/HandyTextLogo.tsx b/src/components/icons/HandyTextLogo.tsx index c32e2e2..fc41bd5 100644 --- a/src/components/icons/HandyTextLogo.tsx +++ b/src/components/icons/HandyTextLogo.tsx @@ -15,30 +15,6 @@ const HandyTextLogo = ({ fill="none" xmlns="http://www.w3.org/2000/svg" > - { + return ( + + + + ); +}; + +export default ResetIcon; diff --git a/src/components/settings/KeyboardShortcuts.tsx b/src/components/settings/KeyboardShortcuts.tsx index 90478eb..28b8f9a 100644 --- a/src/components/settings/KeyboardShortcuts.tsx +++ b/src/components/settings/KeyboardShortcuts.tsx @@ -8,6 +8,7 @@ import { } from "../../lib/types"; import { invoke } from "@tauri-apps/api/core"; import keycode from "keycode"; +import ResetIcon from "../icons/ResetIcon"; export const KeyboardShortcuts: React.FC = () => { const [bindings, setBindings] = React.useState({}); @@ -148,7 +149,7 @@ export const KeyboardShortcuts: React.FC = () => { {Object.entries(bindings).map(([id, binding]) => (

{binding.name}

@@ -158,20 +159,20 @@ export const KeyboardShortcuts: React.FC = () => { {editingShortcutId === id ? (
setShortcutRef(id, ref)} - className="px-2 py-1 text-sm font-semibold border border-[#FAA2CA] bg-[#FAA2CA]/30 rounded min-w-[100px] text-center" + className="px-2 py-1 text-sm font-semibold border border-logo-primary bg-logo-primary/30 rounded min-w-[100px] text-center" > {formatCurrentKeys()}
) : (
startRecording(id)} > {binding.current_binding}
)}
diff --git a/tailwind.config.js b/tailwind.config.js index 89a305e..ed1cda1 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -5,7 +5,15 @@ export default { "./src/**/*.{js,ts,jsx,tsx}", ], theme: { - extend: {}, + extend: { + colors: { + text: 'var(--color-text)', + background: 'var(--color-background)', + 'logo-primary': 'var(--color-logo-primary)', + 'logo-stroke': 'var(--color-logo-stroke)', + 'text-stroke': 'var(--color-text-stroke)', + }, + }, }, plugins: [], } \ No newline at end of file