From ed61a22ab06b394c6f9d876a25db507a424f4313 Mon Sep 17 00:00:00 2001 From: pheralb Date: Wed, 5 Mar 2025 17:44:35 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Add=20alert=20UI=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/api/+page.svelte | 3 ++- src/ui/alert/alert-component.svelte | 36 +++++++++++++++++++++++++++++ tailwind.config.ts | 15 +++++++++++- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 src/ui/alert/alert-component.svelte diff --git a/src/routes/api/+page.svelte b/src/routes/api/+page.svelte index 323430c..5bbf46b 100644 --- a/src/routes/api/+page.svelte +++ b/src/routes/api/+page.svelte @@ -42,7 +42,8 @@ 'prose dark:prose-invert', 'mx-auto max-w-3xl px-4 py-10', 'prose-h2:font-medium prose-h2:tracking-tight prose-h2:underline prose-h2:decoration-neutral-300 prose-h2:underline-offset-[6px] prose-h2:transition-opacity hover:prose-h2:opacity-70 dark:prose-h2:decoration-neutral-700/65', - 'prose-pre:m-0 prose-pre:border prose-pre:border-neutral-200 dark:prose-pre:border dark:prose-pre:border-neutral-800/65' + 'prose-pre:m-0 prose-pre:border prose-pre:border-neutral-200 dark:prose-pre:border dark:prose-pre:border-neutral-800/65', + 'prose-inline-code:rounded prose-inline-code:border prose-inline-code:border-neutral-300 prose-inline-code:bg-neutral-200/50 prose-inline-code:p-[2px] prose-inline-code:font-mono prose-inline-code:dark:border-neutral-800 prose-inline-code:dark:bg-neutral-800/50' )} > diff --git a/src/ui/alert/alert-component.svelte b/src/ui/alert/alert-component.svelte new file mode 100644 index 0000000..faff441 --- /dev/null +++ b/src/ui/alert/alert-component.svelte @@ -0,0 +1,36 @@ + + +
+ {#if icons[type]} + + {/if} +
+ +
+
diff --git a/tailwind.config.ts b/tailwind.config.ts index 1be55cb..fa16311 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,6 +1,7 @@ import type { Config } from 'tailwindcss'; // Plugins: +import plugin from 'tailwindcss/plugin'; import defaultTheme from 'tailwindcss/defaultTheme'; import twTypography from '@tailwindcss/typography'; @@ -28,6 +29,12 @@ const config = { 'font-style': 'normal' } } + }, + quoteless: { + css: { + 'blockquote p:first-of-type::before': { content: 'none' }, + 'blockquote p:first-of-type::after': { content: 'none' } + } } }, colors: { @@ -51,7 +58,13 @@ const config = { 'text-wrap': 'balance' } }); - } + }, + plugin(function ({ addVariant }) { + addVariant( + 'prose-inline-code', + '&.prose :where(:not(pre)>code):not(:where([class~="not-prose"] *))' + ); + }) ] } satisfies Config;