Skip to content

Conversation

@charliecreates
Copy link
Contributor

@charliecreates charliecreates bot commented Dec 5, 2025

Resolves TAM-822

This PR adds a brief note in our graph/recharts component docs describing how we handle colors, including the expected CSS variable format and how those variables are applied within the SVG context.

Changes:

  • Update the graph component documentation to explain our color strategy
  • Clarify how CSS variables are resolved for Recharts/SVG usage
  • Add inline comments near the relevant color-related code to guide future contributors

Notes:

  • This is a documentation-only change; no runtime behavior is modified.
  • The goal is to make it easier for developers to understand and extend our color handling in chart components.

Explain how the graph component consumes v4 theme color tokens:

- Note that v4 defines CSS variables (e.g. `--border`, `--muted-foreground`, `--chart-1`) as full OKLCH color values in `globals-v4.css`
- Clarify that we pass these as `var(--token)` directly to Recharts/SVG props
- Make explicit that we do not wrap these tokens in `hsl()`/`oklch()` when using them in the graph

This provides future readers with a clear reference on why colors are wired this way and avoids confusion when integrating theme tokens with Recharts.
@charliecreates charliecreates bot requested a review from CharlieHelps December 5, 2025 20:34
@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tambo-docs Ready Ready Preview Comment Dec 5, 2025 8:36pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cloud Skipped Skipped Dec 5, 2025 8:36pm
showcase Skipped Skipped Dec 5, 2025 8:36pm

Copy link
Contributor Author

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is purely documentary and technically accurate, but the new comment could be slightly clearer about the relationship between defaultColors (static HSL fallbacks) and the separate v4 var(--token) color path. Clarifying this distinction would avoid potential confusion for future maintainers. No functional, performance, or architectural issues are introduced by this diff.

Additional notes (1)
  • Readability | cli/src/registry/graph/graph.tsx:161-167
    The added comment is clear and accurately explains how v4 theme CSS variables are intended to be used with Recharts/SVG. One small potential source of confusion is that the documented var(--token) usage refers to theme tokens defined elsewhere, while the defaultColors array immediately below still uses hard-coded hsl(...) strings. Future readers might misinterpret this as inconsistent behavior unless they notice that these defaultColors are a fallback separate from the v4 token usage path.
Summary of changes

Summary of Changes

  • Expanded the documentation comment above defaultColors in cli/src/registry/graph/graph.tsx.
  • Clarified that v4 theme color CSS variables (e.g., --border, --muted-foreground, --chart-1) in globals-v4.css store full OKLCH values.
  • Documented that these variables are passed directly as var(--token) to Recharts/SVG props, without wrapping them in hsl()/oklch().
  • Left the actual defaultColors array and runtime behavior unchanged.

@charliecreates charliecreates bot removed the request for review from CharlieHelps December 5, 2025 20:34
@michaelmagan michaelmagan marked this pull request as ready for review December 5, 2025 23:24
@charliecreates charliecreates bot requested a review from CharlieHelps December 5, 2025 23:25
@michaelmagan michaelmagan requested review from lachieh and removed request for CharlieHelps December 5, 2025 23:25
Copy link
Contributor Author

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is documentation-only and technically accurate, but the new comment can be misread as describing defaultColors as v4 token-based colors rather than static HSL fallbacks. Clarifying the separation between v4 var(--token) usage and the defaultColors fallback array will improve maintainability and reduce confusion for future readers. No functional, performance, or architectural issues are introduced by this diff.

Additional notes (1)
  • Readability | cli/src/registry/graph/graph.tsx:158-166
    The new comment accurately documents how v4 theme CSS variables are used in Recharts/SVG, but it can be read as if these defaultColors themselves are coming from v4 tokens, which they are not. That coupling between the comment and the concrete hsl(...) fallbacks below is a bit confusing, especially for someone skimming quickly.

Explicitly calling out that:

  • v4 themed colors use var(--token) (full OKLCH values) in other parts of the graph component; and
  • defaultColors is a static HSL fallback array used when no theme tokens are provided,

would make the relationship clearer and avoid misinterpretation that these HSL values are v4 tokens or OKLCH-based.

This is a documentation-only concern, but tightening it now will save future maintainers time when tracing color behavior.

Summary of changes

Summary of Changes

  • Expanded the documentation comment above defaultColors in cli/src/registry/graph/graph.tsx.
  • Clarified that v4 theme color CSS variables (e.g. --border, --muted-foreground, --chart-1) are full OKLCH values defined in globals-v4.css.
  • Documented that these tokens are passed directly as var(--token) to Recharts/SVG props, without wrapping them in hsl()/oklch().
  • Left the defaultColors array and all runtime behavior unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants