diff --git a/CLAUDE.md b/CLAUDE.md index 518e29d..f45906d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,5 +1,3 @@ -Do not style anything for now - Do not add libraries without asking first or giving me the option to choose a different library ## Commands diff --git a/assets/fonts/Inter-Bold.woff2 b/assets/fonts/Inter-Bold.woff2 new file mode 100644 index 0000000..b26180b Binary files /dev/null and b/assets/fonts/Inter-Bold.woff2 differ diff --git a/assets/fonts/Inter-Medium.woff2 b/assets/fonts/Inter-Medium.woff2 new file mode 100644 index 0000000..7d0fbe9 Binary files /dev/null and b/assets/fonts/Inter-Medium.woff2 differ diff --git a/assets/fonts/Inter-Regular.woff2 b/assets/fonts/Inter-Regular.woff2 new file mode 100644 index 0000000..46568fd Binary files /dev/null and b/assets/fonts/Inter-Regular.woff2 differ diff --git a/assets/fonts/Inter-SemiBold.woff2 b/assets/fonts/Inter-SemiBold.woff2 new file mode 100644 index 0000000..6bb8bee Binary files /dev/null and b/assets/fonts/Inter-SemiBold.woff2 differ diff --git a/assets/styles.css b/assets/styles.css index 82732ce..973384b 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -1,10 +1,74 @@ @import "tailwindcss"; -.fresh-gradient { - background-color: rgb(134, 239, 172); - background-image: linear-gradient( - to right bottom, - rgb(219, 234, 254), - rgb(187, 247, 208), - rgb(254, 249, 195) - ); + +/* Palette, shadows and font from Mozilla Send (__paula/send/tailwind.config.js), Send's -10..-90 scale mapped to 100..900 */ +@theme { + --color-*: initial; + --color-white: #ffffff; + --color-black: #000000; + + --color-gray-100: #f9f9fa; + --color-gray-200: #ededf0; + --color-gray-300: #d7d7db; + --color-gray-400: #b1b1b3; + --color-gray-500: #737373; + --color-gray-600: #4a4a4f; + --color-gray-700: #38383d; + --color-gray-800: #2a2a2e; + --color-gray-900: #0c0c0d; + + --color-primary-200: #cce6ff; + --color-primary-300: #99ccff; + --color-primary-400: #45a1ff; + --color-primary-500: #0a84ff; + --color-primary-600: #0060df; + --color-primary-700: #003eaa; + --color-primary-800: #002275; + --color-primary-900: #000f40; + + --color-error-300: #ff99aa; + --color-error-400: #ff3363; + --color-error-500: #ff0039; + --color-error-600: #d70022; + --color-error-700: #a4000f; + --color-error-800: #5a0002; + --color-error-900: #3e0200; + + --font-sans: + "Inter", system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; + + --shadow-light: 0 0 8px 0 rgba(12, 12, 13, 0.1); + --shadow-big: + 0 12px 18px 2px rgba(34, 0, 51, 0.04), 0 6px 22px 4px rgba(7, 48, 114, 0.12), 0 6px 10px -4px rgba(14, 13, 26, 0.12); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 400; + font-display: optional; + src: url("./fonts/Inter-Regular.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 500; + font-display: optional; + src: url("./fonts/Inter-Medium.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 600; + font-display: optional; + src: url("./fonts/Inter-SemiBold.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 700; + font-display: optional; + src: url("./fonts/Inter-Bold.woff2") format("woff2"); } diff --git a/components/Button.tsx b/components/Button.tsx new file mode 100644 index 0000000..ba5c983 --- /dev/null +++ b/components/Button.tsx @@ -0,0 +1,26 @@ +import type { JSX } from "preact"; + +import { twMerge } from "@/src/tw.ts"; + +const VARIANT_CLASSES = { + primary: + "rounded-lg bg-primary-600 px-6 py-4 font-semibold text-white hover:bg-primary-700 focus:bg-primary-700 disabled:cursor-not-allowed disabled:bg-gray-900/20 dark:bg-primary-400 dark:hover:bg-primary-500 dark:focus:bg-primary-500 dark:disabled:bg-gray-800", + link: + "font-medium text-primary-600 hover:text-primary-700 focus:text-primary-700 disabled:cursor-not-allowed disabled:opacity-50 dark:text-primary-400 dark:hover:text-primary-500 dark:focus:text-primary-500", +}; + +export type ButtonVariant = keyof typeof VARIANT_CLASSES; + +// For elements that should look like a button, e.g. a label wrapping a file input +export function button_class(variant: ButtonVariant = "primary", extra = "") { + return twMerge("cursor-pointer", VARIANT_CLASSES[variant], extra); +} + +interface ButtonProps extends Omit, "class"> { + variant?: ButtonVariant; + class?: string; +} + +export default function Button({ variant, class: extra, type = "button", ...props }: ButtonProps) { + return