From b8ada471fe027a558e060b0ec9dbe6d833399fce Mon Sep 17 00:00:00 2001 From: silberengel Date: Sat, 23 Aug 2025 18:03:27 +0200 Subject: [PATCH] remove first-line indent --- src/app.css | 20 ++++++++++++++++++++ src/lib/utils/markup/basicMarkupParser.ts | 2 +- src/lib/utils/markup/embeddedMarkupParser.ts | 2 +- tailwind.config.cjs | 17 +++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/app.css b/src/app.css index c15dc2d..0d1928c 100644 --- a/src/app.css +++ b/src/app.css @@ -588,4 +588,24 @@ .prose-invert p:first-line { font-weight: normal !important; } + + /* Prevent first-line indentation in prose content */ + .prose p, + .prose-sm p, + .prose-invert p { + text-indent: 0 !important; + } + + /* Ensure embedded event content doesn't have unwanted indentation */ + .embedded-event .prose p, + .embedded-event .prose-sm p, + .embedded-event .prose-invert p { + text-indent: 0 !important; + margin: 0 !important; + } + + /* Prevent indentation for paragraphs with no-indent class */ + .no-indent { + text-indent: 0 !important; + } } diff --git a/src/lib/utils/markup/basicMarkupParser.ts b/src/lib/utils/markup/basicMarkupParser.ts index 5fcc376..3526861 100644 --- a/src/lib/utils/markup/basicMarkupParser.ts +++ b/src/lib/utils/markup/basicMarkupParser.ts @@ -245,7 +245,7 @@ export async function parseBasicmarkup(text: string): Promise { ) { return para; } - return `

${para}

`; + return `

${para}

`; }) .join("\n"); diff --git a/src/lib/utils/markup/embeddedMarkupParser.ts b/src/lib/utils/markup/embeddedMarkupParser.ts index 263d8f1..8813c92 100644 --- a/src/lib/utils/markup/embeddedMarkupParser.ts +++ b/src/lib/utils/markup/embeddedMarkupParser.ts @@ -251,7 +251,7 @@ export async function parseEmbeddedMarkup( return para; } - return `

${para}

`; + return `

${para}

`; }) .join("\n"); diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 5bd3b5f..e994125 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -1,5 +1,6 @@ import flowbite from "flowbite/plugin"; import plugin from "tailwindcss/plugin"; +import typography from "@tailwindcss/typography"; /** @type {import('tailwindcss').Config}*/ const config = { @@ -89,11 +90,27 @@ const config = { hueRotate: { 20: "20deg", }, + typography: { + DEFAULT: { + css: { + // Remove first-line indentation + 'p:first-line': { + 'text-indent': '0', + }, + // Ensure paragraphs don't have unwanted indentation + p: { + 'text-indent': '0', + 'margin': '0', + }, + }, + }, + }, }, }, plugins: [ flowbite(), + typography, plugin(function ({ addUtilities, matchUtilities }) { addUtilities({ ".content-visibility-auto": {