refactor: implement global color token system for centralized theming #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This work corresponds to action item 1 of our Foundation plan,
which we previously discussed via email —
the goal was to replace all manual colors in global CSS with centralized tokens.
By introducing this color token system, we ensure that any color changes made in global.css will automatically propagate across the entire project,
laying the foundation for future custom themes and user-driven color customization.
Description
This PR focuses on implementing a comprehensive color token system to replace all hardcoded colors with centralized, maintainable tokens.
The refactoring introduces a breaking change to ensure consistent theming and easy customization across the entire project.
Changes
token.cssfor primitive colors and semantic tokens inglobals.css.code-hike.cssfile and replaced all hardcoded hex/rgba values with Tailwind’stheme()references.theme().Motivation
Breaking Changes
Color Token Structure
→ All hardcoded colors have been replaced with semantic token references.
Consumers must now use
var(--color-*)variables (e.g.,var(--color-primary),var(--color-background)) instead of static color values.CodeHike Colors
→ CodeHike color values now rely on Tailwind’s
theme()function rather than hardcoded hex codes.File Structure
→ Color definitions are now split across three layers for maintainability:
token.css(primitive colors),code-hike.css(syntax highlighting), andglobals.css(semantic & decorative tokens).