Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/toc-css-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@ainsleydev/sveltekit-helper": patch
---

feat(toc): expose CSS variables on TableOfContents for active colour, border colour and offset

- `--toc-colour-active` — overrides active/hover link colour (fallback: `--token-text-action`)
- `--toc-border-colour` — overrides border colour (fallback: `--colour-light-600`)
- `--toc-border-offset` — overrides `margin-left` and `padding-left` on the border variant (fallback: `$size-48`)
10 changes: 5 additions & 5 deletions packages/sveltekit-helper/src/components/TableOfContents.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,20 @@ export type TableOfContentsProps = {
will-change: color;

&--active {
color: var(--token-text-action);
color: var(--toc-colour-active, var(--token-text-action));
font-weight: var(--font-weight-medium);
}

&:hover {
color: var(--token-text-action);
color: var(--toc-colour-active, var(--token-text-action));
}
}

@include a.mq(tablet) {
&--border {
margin-left: a.$size-48;
padding-left: a.$size-48;
border-left: 1px solid var(--colour-light-600);
margin-left: var(--toc-border-offset, #{a.$size-48});
padding-left: var(--toc-border-offset, #{a.$size-48});
border-left: 1px solid var(--toc-border-colour, var(--colour-light-600));
}
}
}
Expand Down
Loading