Skip to content

docs: improve link contrast in note blocks for dark mode#6440

Merged
KATT merged 1 commit intotrpc:nextfrom
Pieczasz:fix/6224-dark-mode-note-links
Feb 2, 2025
Merged

docs: improve link contrast in note blocks for dark mode#6440
KATT merged 1 commit intotrpc:nextfrom
Pieczasz:fix/6224-dark-mode-note-links

Conversation

@Pieczasz
Copy link
Copy Markdown
Contributor

@Pieczasz Pieczasz commented Feb 2, 2025

  • Adjust link colors in .theme-admonition-note for better visibility
  • Fix accessibility issue with link contrast

Fixes #6224
Closes #6224

🎯 Changes

This PR improves the visibility of links within note blocks (.theme-admonition-note) in dark mode by adjusting their color contrast to meet WCAG accessibility standards.

Before:
Xnip2025-02-02_12-44-28
Xnip2025-02-02_12-44-37

After:
Xnip2025-02-02_12-42-33
Xnip2025-02-02_12-43-49

Changed files:

  • www/src/css/custom.css: Updated link colors in note blocks for dark mode

✅ Checklist

  • I have followed the steps listed in the Contributing guide
  • If necessary, I have added documentation related to the changes made
  • I have added or updated the tests related to the changes made
    • N/A - This is a purely visual documentation change

Summary by CodeRabbit

  • Style
    • Enhanced dark mode presentation by updating the appearance of links in note sections. The new styling applies a clearer sky-blue color and a subtle hover effect, leading to improved readability and a more consistent visual experience for users in dark mode.

- Adjust link colors in .theme-admonition-note for better visibility
- Fix accessibility issue with link contrast

Fixes trpc#6224
@Pieczasz Pieczasz requested a review from a team as a code owner February 2, 2025 11:45
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2025 11:48am

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 2, 2025

@Pieczasz is attempting to deploy a commit to the trpc Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 2, 2025

Walkthrough:

This pull request adds a new CSS rule in custom.css that targets the .theme-admonition-note a selector for dark mode. The rule applies dark:text-sky-300 and dark:hover:text-sky-400 classes, enhancing link contrast in note blocks under dark mode. No existing styles were modified.

Changes:

Files Change Summary
www/src/css/custom.css Added a new CSS rule for .theme-admonition-note a to improve dark mode contrast styling.

Assessment against linked issues:

Objective Addressed Explanation
Fix contrast for links in note blocks in Dark Mode (#6224)

Poem:

I'm a bunny, hopping with glee,
Seeing improved links makes me so free!
CSS magic in the dark, oh what a sight,
Carrots, code, and joy in every byte.
Hoppy changes shine in the moonlight!
🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9fe966 and 27664e6.

📒 Files selected for processing (1)
  • www/src/css/custom.css (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (19)
  • GitHub Check: E2E-tests (tanstack-start)
  • GitHub Check: E2E-tests (standalone-server)
  • GitHub Check: E2E-tests (soa)
  • GitHub Check: E2E-tests (next-prisma-websockets-starter)
  • GitHub Check: E2E-tests (next-prisma-todomvc)
  • GitHub Check: E2E-tests (next-prisma-starter)
  • GitHub Check: E2E-tests (next-minimal-starter)
  • GitHub Check: E2E-tests (next-formdata)
  • GitHub Check: E2E-tests (minimal-react)
  • GitHub Check: E2E-tests (fastify-server)
  • GitHub Check: E2E-tests (express-server)
  • GitHub Check: E2E-tests (express-minimal)
  • GitHub Check: E2E-tests (cloudflare-workers)
  • GitHub Check: E2E-tests (.test/ssg)
  • GitHub Check: E2E-tests (.test/internal-types-export)
  • GitHub Check: E2E-tests (.test/diagnostics-big-router)
  • GitHub Check: E2E-tests (Bun) (bun, ubuntu-latest)
  • GitHub Check: E2E-tests (.experimental/next-app-dir)
  • GitHub Check: Lint and auto-fix
🔇 Additional comments (1)
www/src/css/custom.css (1)

265-267: New CSS Rule for Improved Note Block Link Contrast

This new rule for .theme-admonition-note a applies the Tailwind utility classes dark:text-sky-300 and dark:hover:text-sky-400 to ensure that links within note blocks are clearly visible in dark mode. This change directly addresses the accessibility issue by enhancing contrast, in line with WCAG guidelines. It would be beneficial to verify the contrast ratios using a tool or design system check to ensure they fully meet WCAG standards.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 2, 2025

Open in Stackblitz

npm i https://pkg.pr.new/trpc/trpc/@trpc/client@6440
npm i https://pkg.pr.new/trpc/trpc/@trpc/next@6440
npm i https://pkg.pr.new/trpc/trpc/@trpc/server@6440
npm i https://pkg.pr.new/trpc/trpc/@trpc/react-query@6440

commit: 27664e6

@KATT KATT enabled auto-merge (squash) February 2, 2025 12:14
@KATT KATT merged commit c6e2295 into trpc:next Feb 2, 2025
@Pieczasz Pieczasz deleted the fix/6224-dark-mode-note-links branch February 2, 2025 16:03
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2025

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Fix contrast for links in note blocks in Dark Mode

2 participants