Examples/Try it inherits the font color from browser prefs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 233
- Forks
- 61
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 82
Description
Summary
If user changes font color in the browser settings, the text in the examples will also change it, but the background will remain white. This can cause contrast issues.
URL
Any page with Examples section, e.g:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#examples
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter#examples
Reproduction steps
- Go to
about:config, - Change the value of;
browser.anchor_colorto#ff0000,browser.visited_colorto#00ff00,browser.display.foreground_colorto#ffffff,browser.display.background_colorto#000000,
- Go to;
- See red/lime links and white text on white background.
Expected behavior
Links and text shouldn't change color based on these prefs.
Actual behavior
Links and text change color depending on these prefs.
Device
Desktop
Browser
Firefox
Browser version
Pre-release (e.g. Beta, Nightly or Canary)
Operating system
Linux
Screenshot
Example video with browser.anchor_color. From the first URL.
Example screenshot with browser.display.foreground_color = #ffffff. Only the selected part of the text is visible. From the second URL.

Anything else?
The Try it boxes have a similar problem only with links. Should this be a new bug report?
Validations
- I have read the Community Participation Guidelines.
- I have verified that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- I have checked that this is a concrete bug. For Q&A open a GitHub Discussion.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue on the Examples pages for the HTML a and meter elements using the listed Firefox about:config color preferences. Start by tracing the Examples and Try it sections in the frontend; done means their text and links retain readable colors instead of inheriting browser preferences, with the reported contrast issue no longer visible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100