Skip to content

fix: Fix HyperDX primary button styling and SSR hydration#1706

Merged
elizabetdev merged 4 commits intomainfrom
fix/hyperdx-theme-ssr-button-styling
Feb 6, 2026
Merged

fix: Fix HyperDX primary button styling and SSR hydration#1706
elizabetdev merged 4 commits intomainfrom
fix/hyperdx-theme-ssr-button-styling

Conversation

@elizabetdev
Copy link
Contributor

Summary

  • Fixes primary button CSS variable definitions in HyperDX theme
  • Adds theme class during SSR to prevent hydration mismatch

Changes

1. Primary Button CSS Variables (_tokens.scss)

Updated primary button variables to use Mantine's green-light colors (properly defined) instead of undefined references:

  • --color-primary-button-bg: var(--mantine-color-green-light)
  • --color-primary-button-bg-hover: var(--mantine-color-green-light-hover)
  • --color-primary-button-text: var(--mantine-color-green-light-color)

Added to both dark mode and light mode mixins.

2. SSR Hydration Fix (_document.tsx)

Added theme class (e.g., theme-hyperdx) to the HTML element during server-side rendering. Previously, the theme class was only applied client-side via useEffect, which could cause a hydration mismatch where CSS variables weren't available on first render.

Test Plan

  • Verify primary buttons display correctly in HyperDX theme (dark & light mode)
  • Verify no hydration warnings in console
  • Verify ClickStack theme still works as expected
  • Test with NEXT_PUBLIC_THEME=hyperdx explicitly set

elizabetdev and others added 3 commits February 5, 2026 18:39
When NEXT_PUBLIC_THEME was explicitly set to 'hyperdx', primary buttons
displayed with Mantine's default styling instead of the custom theme
styling. This was caused by the theme class not being applied during
server-side rendering, leading to a hydration mismatch.

This fix adds the theme class (e.g., 'theme-hyperdx') to the HTML element
in _document.tsx, ensuring CSS variables are correctly applied from the
first render.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replaced Mantine's default button styles with custom theme variables for primary buttons. This change enhances consistency in button styling across the application by utilizing defined color tokens for background, hover, and text colors.
…alette

Replaced existing primary button color variables with Mantine's green light colors for background, hover, and text. This change ensures a more cohesive design by aligning button styles with the overall theme.
@vercel
Copy link

vercel bot commented Feb 5, 2026

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

Project Deployment Actions Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview, Comment Feb 6, 2026 6:20pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: 3b7f9e0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@claude
Copy link

claude bot commented Feb 5, 2026

PR Review

✅ No critical issues found.

The changes correctly:

  • Fix SSR hydration mismatch by applying theme class during server-side rendering in _document.tsx
  • Use proper Mantine-generated CSS variables (--mantine-color-green-light*) that are automatically created from the primaryColor: "green" configuration
  • Maintain consistency with the clickstack theme pattern for button styling
  • Apply semantic CSS variable indirection through --color-primary-button-* tokens

The implementation follows Mantine v7 best practices and HyperDX theme architecture patterns.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

E2E Test Results

All tests passed • 63 passed • 4 skipped • 802s

Status Count
✅ Passed 63
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 4

Tests ran across 4 shards in parallel.

View full report →

@elizabetdev elizabetdev merged commit 42820f3 into main Feb 6, 2026
13 checks passed
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