Skip to content

🎨 Palette: Add light/dark mode toggle to documentation#11

Draft
igor-holt wants to merge 1 commit intomainfrom
palette-docs-light-dark-toggle-3779802801518276903
Draft

🎨 Palette: Add light/dark mode toggle to documentation#11
igor-holt wants to merge 1 commit intomainfrom
palette-docs-light-dark-toggle-3779802801518276903

Conversation

@igor-holt
Copy link
Owner

🎨 Palette: Documentation Accessibility Improvement

💡 What: Added a light/dark mode toggle to the documentation site configuration (mkdocs.yml).

🎯 Why: Previously, the documentation was locked to dark mode (slate). This change allows users to switch between light and dark modes based on their preference and environment, improving readability and accessibility.

📸 Before/After:

  • Before: Site was always in dark mode.
  • After: Site has a toggle button in the header to switch between light and dark modes.

Accessibility:

  • Provides choice for users with visual impairments or astigmatism who may find high contrast dark mode difficult to read.
  • Uses standard accessible icons with descriptive tooltips ("Switch to dark mode", "Switch to light mode").

PR created automatically by Jules for task 3779802801518276903 started by @igor-holt

This change introduces a light/dark mode toggle to the documentation site,
improving accessibility and user experience for users who prefer different
reading environments.

- Adds `scheme: default` (light mode) alongside `scheme: slate` (dark mode).
- Configures `toggle` icons using `material/brightness-7` and `material/brightness-4`.
- Preserves brand colors (`primary: black`, `accent: amber`) for both schemes.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist
Copy link

Summary of Changes

Hello @igor-holt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the accessibility and user experience of the documentation site by introducing a light/dark mode toggle. This change empowers users to select their preferred viewing theme, improving readability and accommodating diverse visual needs, rather than being restricted to a single dark mode.

Highlights

  • Documentation Accessibility: Implemented a light/dark mode toggle in the documentation site, moving from a dark-mode-only setup to a user-selectable theme.
  • Configuration Update: Modified mkdocs.yml to define both 'default' (light) and 'slate' (dark) color schemes, each with specific toggle icons and descriptive names.
Changelog
  • .Jules/palette.md
    • Added a new entry documenting the learning and action taken regarding documentation accessibility and mkdocs.yml configuration for dual-scheme support.
  • mkdocs.yml
    • Configured the palette section to define two distinct color schemes: 'default' for light mode and 'slate' for dark mode.
    • Assigned specific Material Design icons (material/brightness-7 and material/brightness-4) and descriptive names ("Switch to dark mode", "Switch to light mode") for the theme toggles.
Activity
  • PR created automatically by Jules for task 3779802801518276903, initiated by @igor-holt.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a light/dark mode toggle to the documentation, which is a great step for accessibility. However, I've found a critical accessibility issue with the new light mode: the color contrast for links is too low, failing WCAG standards. I've left a comment with details on this in mkdocs.yml. Additionally, I've suggested an improvement to the new .Jules/palette.md file to incorporate contrast checking into the team's process to prevent similar issues in the future.

Comment on lines +11 to +16
- scheme: default
primary: black
accent: amber
toggle:
icon: material/brightness-7
name: Switch to dark mode

Choose a reason for hiding this comment

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

critical

This change introduces a critical accessibility issue in light mode. The link color, defined as --color-extropic-orange (#ff6a13) in custom_css.css, has a contrast ratio of only 2.65:1 against a white background. This fails the WCAG AA requirement of 4.5:1 for normal text.

Since this pull request's goal is to improve accessibility, this color contrast regression must be addressed. While the issue is in custom_css.css, it is surfaced by enabling the light theme here. Please update the link color for the light theme to meet accessibility standards.

@@ -0,0 +1,3 @@
## 2026-02-13 - [Documentation Accessibility]
**Learning:** Providing a light/dark mode toggle in technical documentation significantly improves accessibility for users with different visual preferences or needs, especially when reading long-form content.
**Action:** Always verify `mkdocs.yml` configuration to ensure dual-scheme support is enabled with clear toggle icons.

Choose a reason for hiding this comment

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

medium

To make this action item more robust and prevent future accessibility issues like the one discovered in this PR (low contrast links in light mode), I suggest expanding it to include color contrast verification.

Suggested change
**Action:** Always verify `mkdocs.yml` configuration to ensure dual-scheme support is enabled with clear toggle icons.
**Action:** Always verify `mkdocs.yml` configuration to ensure dual-scheme support is enabled with clear toggle icons and that color contrast for text and interactive elements meets accessibility standards (e.g., WCAG AA) in both schemes.

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.

1 participant