Browse Source

remove first-line indent

master
silberengel 7 months ago
parent
commit
b8ada471fe
  1. 20
      src/app.css
  2. 2
      src/lib/utils/markup/basicMarkupParser.ts
  3. 2
      src/lib/utils/markup/embeddedMarkupParser.ts
  4. 17
      tailwind.config.cjs

20
src/app.css

@ -588,4 +588,24 @@ @@ -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;
}
}

2
src/lib/utils/markup/basicMarkupParser.ts

@ -245,7 +245,7 @@ export async function parseBasicmarkup(text: string): Promise<string> { @@ -245,7 +245,7 @@ export async function parseBasicmarkup(text: string): Promise<string> {
) {
return para;
}
return `<p class="my-4">${para}</p>`;
return `<p class="my-4 no-indent">${para}</p>`;
})
.join("\n");

2
src/lib/utils/markup/embeddedMarkupParser.ts

@ -251,7 +251,7 @@ export async function parseEmbeddedMarkup( @@ -251,7 +251,7 @@ export async function parseEmbeddedMarkup(
return para;
}
return `<p class="my-1">${para}</p>`;
return `<p class="my-1 no-indent">${para}</p>`;
})
.join("\n");

17
tailwind.config.cjs

@ -1,5 +1,6 @@ @@ -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 = { @@ -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": {

Loading…
Cancel
Save