Skip to content

[@W-21514384] fix(api-type-document): use transparent/inherit fallbacks for union buttons in dark mode#98

Merged
alexpmule merged 4 commits intomainfrom
fix/dark-mode-union-buttons
Mar 10, 2026
Merged

[@W-21514384] fix(api-type-document): use transparent/inherit fallbacks for union buttons in dark mode#98
alexpmule merged 4 commits intomainfrom
fix/dark-mode-union-buttons

Conversation

@alexpmule
Copy link
Copy Markdown
Contributor

@alexpmule alexpmule commented Mar 10, 2026

Summary

Fixes invisible oneOf/union/anyOf (and media type) toggle buttons in dark mode: text was white on white because fallbacks used #fff background and #000 color while the theme set a global light text color.

Changes

  • src/TypeStyles.js: For .union-toggle, .one-of-toggle, .any-of-toggle, and .media-toggle, fallbacks changed from #fff/#000 to transparent/inherit so they inherit from the theme. Activated state (#cddc39 background, #000 text) unchanged.
  • test/api-type-document.test.js: New test ensuring union toggle buttons do not use hardcoded white background (rgb(255, 255, 255)).
  • demo/index.html: Added "Dark mode" toggle (bottom-right) to verify the fix; preference stored in localStorage.
  • Version: Bumped to 4.2.43.

Verification

  • npm test passes (549 passed)
  • Union/oneOf/anyOf and media buttons use transparent/inherit fallbacks
  • Active button styling unchanged
  • Manual check in demo with Dark mode enabled

Related

Fix:
Screenshot 2026-03-10 at 3 12 48 PM

Button to enable dark mode in demo:
Screenshot 2026-03-10 at 3 18 45 PM

@alexpmule alexpmule self-assigned this Mar 10, 2026
…ility

- Refactored grpc-test.json to enhance the structure and ensure better compatibility with the API documentation.
- Removed outdated entries and streamlined the data format for clarity and efficiency.
- This change aims to support future enhancements and maintain consistency across the API models.
@salesforce-cla
Copy link
Copy Markdown

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Alex Perez <a***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

@alexpmule alexpmule force-pushed the fix/dark-mode-union-buttons branch from be34258 to 86a320d Compare March 10, 2026 18:59
grpc-test.json was replaced with a different model; tests expect
SayHello1/SayHello2 and link-target structure. Use grpc-test-old.json
and add it to repo (exception in .gitignore) so CI passes.

Made-with: Cursor
@alexpmule alexpmule force-pushed the fix/dark-mode-union-buttons branch from d4848f9 to c292d38 Compare March 10, 2026 19:07
@alexpmule alexpmule merged commit c9751a9 into main Mar 10, 2026
4 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