Skip to content

feat: Updated editor body colors - #3206

Open
matthewlipski wants to merge 2 commits into
a11y-testingfrom
contrast-fixes
Open

matthewlipski wants to merge 2 commits into
a11y-testingfrom
contrast-fixes

Conversation

@matthewlipski

@matthewlipski matthewlipski commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR updates editor body colors (UI elements like menus and toolbars are out of scope) to hit WCAG 2.0 AA contrast requirements and converts their CSS variables to use the OKLCH color space instead of RGB. OKLCH is a polar color space similar to HSL, but has 2 key advantages:

  1. It supports wide color gamuts. Computer displays can't reproduce all colors that the human eye can see, and the color gamut that a display is capable of showing varies. This means that the same HSL color can end up looking washed out on one display and oversaturated on another, unless they're calibrated to the same gamut. OKLCH uses arbitrary values for its equivalent saturation and lightness rather than being mapped directly to display output, so colors look much more consistent across different displays.
  2. It takes into account human perception of color and contrast. In HSL, a gradient created by sweeping across all hue values will have noticeable darker and lighter bands some colors appear brighter or darker to us at the same luminance level. OKLCH accounts for this, so sweeping the hue results in a much smoother gradient.

The second advantage is useful to us as it makes it much easier to ensure each highlight color has the same relative saturation and brightness. With HSL/RGB, it takes a lot of trial and error to do this. The first advantage is relevant as the new colors all fall within the sRGB gamut, which pretty much all modern displays have good coverage of.

While the most significant changes have been made to highlight colors, the following colors have been adjusted too to hit the contrast requirements:

  • Dark mode quote block text
  • Dark mode add file button text
  • Toggle block "add block" button text

Verified that axe scans from out a11y tests no longer report contrast issues. An important thing to note is that placeholder contrast is currently untested and so placeholder colors have not been updated as part of this PR, only colors which have been caught to not pass WCAG contrast requirements when running an axe scan of the editor body. See #3205 for more info.

There's a temporary highlight-color-comparison.html file to inspect the old vs new highlight colors (to be removed before merging). The screenshots below are taken from it.

Closes #2852
Closes #2827
Closes #3043

Rationale

The old colors were hard to read at times and didn't conform to a11y standards.

Changes

  • Updated CSS.
  • Added example to view all combinations of highlight colors.

Impact

N/A

Testing

axe-core scan no longer brings up contrast issues for editor body.

Screenshots/Video

Screenshot 2026-10-16 at 19 00 40 Screenshot 2026-10-16 at 19 00 51

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Additional Notes

N/A

@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
blocknote Ready Ready Preview Oct 16, 2026 5:01pm UTC
blocknote-website Ready Ready Preview Oct 16, 2026 5:01pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d517fbe3-7fa1-42ad-87b2-165ad082e04b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…hts to have consistent brightness & saturation across colors
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-3206/

Built to branch gh-pages at 2026-10-16 17:10 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@@ -0,0 +1,3876 @@
<!doctype html>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How is this file generated, should it be checked in?

[data-content-type="quote"] blockquote {
border-left: 2px solid rgb(125, 121, 122);
color: rgb(125, 121, 122);
color: #646362;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should the hardcoded colors changed in this file actually be variables instead? Might be nice to clean up at same time

This branch was successfully deployed

2 active deployments
Preview – blocknote-website — ce8024fc Deployed Oct 16, 2026 by vercel[bot]
Preview – blocknote — ce8024fc Deployed Oct 16, 2026 by vercel[bot]
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