Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.
This repository was archived by the owner on May 14, 2025. It is now read-only.

Interactive examples are sometimes still not adhering to the current theme #734

@schalkneethling

Description

@schalkneethling

Is this considered fixed? I'm still experiencing inconsistent theme adherance.

What is the problem?

If the theme is toggled to light mode on a page without an interactive editor, subsequently navigating to a page with an interactive editor will display the editor in dark mode.

Steps to reproduce the issue

  1. With dark mode toggle on navigate to a page without an Interactive Editor (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator)
  2. Toggle light mode on
  3. Navigate to a page with an Interactive Editor (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)

5454

Environment

Device

Desktop

Browsers

Firefox: 98.0.1 (64-bit)
Chrome: Version 99.0.4844.51 (Official Build) (x86_64)
Brave: Version 1.36.112 Chromium: 99.0.4844.51 (Official Build) (x86_64)
Safari: Version 15.3 (17612.4.9.1.8)

Operating system

Mac OS: 12.2.1

Originally posted by @pilchard in mdn/yari#5428 (comment)

Activity

added
needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.
on Mar 15, 2022
schalkneethling

schalkneethling commented on Mar 15, 2022

@schalkneethling
Author

Thank you, @pilchard. I have seen there are some edge cases where this is still problematic.

transferred this issue frommdn/yarion Mar 15, 2022
removed
needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.
on Mar 15, 2022
caugner

caugner commented on May 3, 2022

@caugner
Contributor

The reason for this is that we postMessage the new theme to all IEx iframes on the page whenever the theme changes, which in turn stores the theme in IEx localStorage (which is independent from MDN localStorage!). However, when the page has no IEx iframe, that message gets lost and the old theme is still stored in IEx localStorage.

A solution would be to have either IEx iframes "ask" their MDN parent for the current theme, or to have the MDN parent listen for IEx iframes using MutationObserver or similar and postMessage the current theme proactively.

added
effort: mediumThis task is a medium effort.
p3We don't have visibility when this will be addressed.
on Jun 24, 2024
caugner

caugner commented on Mar 14, 2025

@caugner
Contributor

This should be resolved with migrating interactive examples inline, so we won't fix it in bob, which is in the process of being archived.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @caugner@schalkneethling

        Issue actions

          Interactive examples are sometimes still not adhering to the current theme · Issue #734 · mdn/bob