Fix inline toolbar background for dark mode#102
Merged
Conversation
Replace the hardcoded `$('#inline_toolbar').css('background-color',
'#ffffff')` call with a CSS injection into the ace_outer iframe document.
The injected <style> uses a prefers-color-scheme: dark media query so the
toolbar automatically switches between the Etherpad light-mode toolbar
colour (#f4f4f4) and a dark-mode colour (#1a1a1a) without any JS
re-evaluation.
Also add a regression test that asserts:
- a prefers-color-scheme: dark rule is present in the source
- the hardcoded white background via .css() is not used
Agent-Logs-Url: https://github.com/ether/ep_inline_toolbar/sessions/1465865b-03bd-4d78-a983-28e9cb52797d
Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Copilot
AI
changed the title
[WIP] Fix background color for dark mode
Fix inline toolbar background for dark mode
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The inline toolbar background was hardcoded to
#ffffffinpostToolbarInit, so it stayed white regardless of the user's colour scheme.Changes
static/js/index.js: Replace the JS.css('background-color', '#ffffff')call with a<style>injection into theace_outeriframe document. Usesprefers-color-scheme: darkso the browser handles switching automatically — no JS re-evaluation needed. Colours mirror Etherpad's own toolbar (#f4f4f4light /#1a1a1adark).static/tests/backend/specs/background_fix.js: Add regression assertions —prefers-color-scheme: darkrule must be present in source, and hardcoded white via.css()must not be used.