on master help sign in
TableOfContents: highlight category titles
8755bd2Matilde Park
components/TableOfContents.js+5−1
@@ -56,7 +56,11 @@ const Headings = ({ headings, activeId }) => (
56 {headings.map((heading, index) => (
56 {headings.map((heading, index) => (
57 <li key={heading.id}>
57 <li key={heading.id}>
58 <a
58 <a
59+ className={classNames({
60+ "font-bold": index === 0,
59− className={index === 0 ? "font-bold" : "font-medium text-sm"}
61+ "font-medium text-sm": index !== 0,
62+ "text-green-400": heading.id === activeId && index !== 0,
63+ })}
60 href={`#${heading.id}`}
64 href={`#${heading.id}`}
61 >
65 >
62 {heading.title}
66 {heading.title}