Skip to content

Commit e937a8c

Browse files
committed
Style questions
1 parent 6269378 commit e937a8c

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

src/components/faq-aggregator/index.tsx

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { getMdxHeadings } from "@/_design-system/mdx-components/get-mdx-headings"
44
import { type ReactNode, useRef, useLayoutEffect, useState } from "react"
5+
import ArrowDown from "@/app/conf/_design-system/pixelarticons/arrow-down.svg?svgr"
56

67
function slugify(text: string): string {
78
return String(text)
@@ -28,34 +29,17 @@ function FaqH1({ id, children }: { id?: string; children?: ReactNode }) {
2829
function FaqH2({ id, children }: { id?: string; children?: ReactNode }) {
2930
const slug = id ?? slugify(String(children))
3031
return (
31-
<details className="group border-b border-neu-100 dark:border-neu-200 [&:first-of-type]:border-t [&>p:first-of-type]:!mt-0">
32-
<summary className="flex cursor-pointer list-none items-center justify-between gap-4 py-4 [&::-webkit-details-marker]:hidden">
32+
<details className="group mt-4 border border-neu-400 bg-neu-0 *:px-3 dark:border-neu-200 lg:mt-6 [&:first-of-type]:border-t [&>:last-child]:mb-3 [&>p:first-of-type]:!mt-3">
33+
<summary className="gql-focus-visible flex cursor-pointer list-none items-center justify-between gap-4 p-3 group-open:border-b group-hover:bg-neu-100 [&::-webkit-details-marker]:hidden">
3334
<h3 id={slug} className="typography-body-lg text-neu-900">
3435
{children}
3536
</h3>
36-
<ChevronIcon className="size-5 shrink-0 text-neu-600 transition-transform group-open:rotate-180" />
37+
<ArrowDown className="size-10 shrink-0 text-neu-800 group-open:rotate-180" />
3738
</summary>
3839
</details>
3940
)
4041
}
4142

42-
function ChevronIcon({ className }: { className?: string }) {
43-
return (
44-
<svg
45-
xmlns="http://www.w3.org/2000/svg"
46-
viewBox="0 0 24 24"
47-
fill="none"
48-
stroke="currentColor"
49-
strokeWidth={2}
50-
strokeLinecap="round"
51-
strokeLinejoin="round"
52-
className={className}
53-
>
54-
<polyline points="6 9 12 15 18 9" />
55-
</svg>
56-
)
57-
}
58-
5943
export function FaqAggregator({ children }: { children: ReactNode }) {
6044
const containerRef = useRef<HTMLDivElement>(null)
6145
const [, forceUpdate] = useState(0)

0 commit comments

Comments
 (0)