fix: FAQ answer alignment + font size, ServicesGrid button

This commit is contained in:
Jeffrey 2026-03-02 10:45:08 +01:00
parent fa5fbe277c
commit 5090c0f743
3 changed files with 52 additions and 18 deletions

View File

@ -891,11 +891,46 @@ html:not([data-theme]) {
margin: 2.5rem 0; margin: 2.5rem 0;
} }
/* Reset Payload's default padding on the richtext container /* Payload Lexical Rich Text Global Indentation Reset
so it aligns with the parent block's layout. Strips ALL padding/margin from the .payload-richtext wrapper AND its
Two selectors: descendant (blocks) and same-element (posts page) */ direct children that Lexical's serialiser may inject. Uses !important
to override any inline styles Payload adds to the container.
The fd-prose-scoped selectors are kept as a fallback.
*/
.payload-richtext {
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
padding-inline-start: 0 !important;
padding-inline-end: 0 !important;
}
/* First paragraph inside richtext: kill top margin so text sits flush
against whichever heading or label appears above */
.payload-richtext > p:first-child,
.payload-richtext > div:first-child > p:first-child {
margin-top: 0;
}
/* Lexical sometimes wraps content in an inner div — strip that too */
.payload-richtext > div {
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
padding-inline-start: 0 !important;
}
/* Ensure paragraphs inside richtext don't carry stray padding or indent */
.payload-richtext p {
padding-inline-start: 0 !important;
text-indent: 0 !important;
}
/* Legacy scoped selectors (posts wrapped in fd-prose) */
.fd-prose .payload-richtext, .fd-prose .payload-richtext,
.fd-prose.payload-richtext { .fd-prose.payload-richtext {
padding-left: 0; padding-left: 0 !important;
padding-right: 0; padding-right: 0 !important;
} }

View File

@ -87,7 +87,7 @@ export const FDFaqBlockComponent: React.FC<FDFaqBlockProps> = ({
}`} }`}
> >
<div className="overflow-hidden"> <div className="overflow-hidden">
<div className={`pl-7 md:pl-9 font-joey text-fd-body fd-prose ${proseColor}`}> <div className={`font-joey text-fd-body-lg fd-prose ${proseColor}`}>
<RichText data={(item.answer) as any} enableGutter={false} enableProse={false} /> <RichText data={(item.answer) as any} enableGutter={false} enableProse={false} />
</div> </div>
</div> </div>

View File

@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import type { FDServicesGridBlock as FDServicesGridBlockProps, Media } from '@/payload-types' import type { FDServicesGridBlock as FDServicesGridBlockProps, Media } from '@/payload-types'
import { FDImage } from '@/components/FDImage' import { FDImage } from '@/components/FDImage'
import { FDButton } from '@/components/FDButton'
const columnClasses: Record<string, string> = { const columnClasses: Record<string, string> = {
'2': 'grid-cols-1 md:grid-cols-2', '2': 'grid-cols-1 md:grid-cols-2',
@ -28,8 +29,8 @@ export const FDServicesGridBlockComponent: React.FC<FDServicesGridBlockProps> =
{services?.map((service, index) => { {services?.map((service, index) => {
const media = service.image as Media const media = service.image as Media
const content = ( return (
<div className="flex flex-col gap-4 md:gap-6 lg:gap-[30px]"> <div key={index} className="flex flex-col gap-4 md:gap-6 lg:gap-[30px]">
<h3 className="font-joey-bold text-fd-navy dark:text-white text-fd-h2"> <h3 className="font-joey-bold text-fd-navy dark:text-white text-fd-h2">
{service.title} {service.title}
</h3> </h3>
@ -47,18 +48,16 @@ export const FDServicesGridBlockComponent: React.FC<FDServicesGridBlockProps> =
<p className="font-joey text-fd-navy dark:text-white/80 text-fd-body px-3"> <p className="font-joey text-fd-navy dark:text-white/80 text-fd-body px-3">
{service.description} {service.description}
</p> </p>
{service.link && (
<div className="px-3 mt-auto">
<FDButton href={service.link} variant="outline" className="py-2 px-5 text-fd-small">
Läs mer
</FDButton>
</div>
)}
</div> </div>
) )
if (service.link) {
return (
<a key={index} href={service.link} className="group hover:opacity-90 transition-opacity">
{content}
</a>
)
}
return <div key={index}>{content}</div>
})} })}
</div> </div>
</div> </div>