update ToC logic

This commit is contained in:
Jesse Winton
2025-02-26 15:16:16 -05:00
parent 79677476c7
commit 63b22f0fdb
2 changed files with 6 additions and 10 deletions

View File

@@ -1,7 +1,9 @@
<script lang="ts" context="module">
export const extractHeadings = () => {
const headings: Array<string> = [];
let headings: Array<string> = [];
headings.push('Accessibility in design systems');
headings.push('Use high color contrast');
headings.push('Not relying on color');
return headings;
};
</script>
@@ -9,17 +11,13 @@
<script lang="ts">
import { classNames } from '$lib/utils/classnames';
export let headings: Array<string> = [
'Accessibility in design systems',
'Use high color contrast',
'Not relying on color'
];
const backToTop = () => {
window.scrollTo({ top: 0, behavior: 'smooth' });
};
let activeIndex: number = 0;
const headings = extractHeadings();
</script>
<nav class="border-smooth col-span-3 ml-4 hidden border-l lg:block">