feat: Add CSS custom properties for TableOfContents styling#433
feat: Add CSS custom properties for TableOfContents styling#433ainsleyclark merged 3 commits intomainfrom
Conversation
…offset Callers can now override: --toc-color-active (fallback: --token-text-action) --toc-border-color (fallback: --colour-light-600) --toc-border-offset (fallback: $size-48, shared by margin-left and padding-left) https://claude.ai/code/session_01Krrs4t3uZKDuAx6vk69JPw
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This comment has been minimized.
This comment has been minimized.
--toc-color-active → --toc-colour-active --toc-border-color → --toc-border-colour https://claude.ai/code/session_01Krrs4t3uZKDuAx6vk69JPw
Review summary
Clean, minimal change that correctly wraps hardcoded values in CSS custom properties with fallbacks, preserving full backward compatibility. One naming discrepancy between the PR description and the implementation worth noting. Critical issues 🔴None Warnings 🟡1. PR description documents wrong variable name The PR description states the active colour variable as Suggestions 🟢1. Document that The changeset entry for 2. Consider The border colour is now configurable via |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #433 +/- ##
==========================================
+ Coverage 64.59% 70.26% +5.67%
==========================================
Files 154 187 +33
Lines 6064 7439 +1375
==========================================
+ Hits 3917 5227 +1310
+ Misses 2064 2012 -52
- Partials 83 200 +117 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Enhanced the TableOfContents component with customizable CSS variables, allowing consumers to override default styling without modifying the component code.
Key Changes
var(--token-text-action)withvar(--toc-color-active, var(--token-text-action))for active and hover states, enabling custom active link colorsa.$size-48spacing values withvar(--toc-border-offset, #{a.$size-48})for the left margin and padding on tablet breakpoint, allowing customizable border offsetvar(--colour-light-600)withvar(--toc-border-color, var(--colour-light-600))for the left border color, enabling custom border stylingImplementation Details
All changes use CSS custom properties with fallback values, ensuring backward compatibility. The fallbacks preserve the original styling behavior when custom properties are not defined, allowing for gradual adoption of customization.
https://claude.ai/code/session_01Krrs4t3uZKDuAx6vk69JPw