Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The classTarget=html affect the root instead of the html inside the preview #234

Open
C0ZEN opened this issue Apr 5, 2023 · 2 comments
Open

Comments

@C0ZEN
Copy link

C0ZEN commented Apr 5, 2023

From the docs, the option classTarget will be passed to a querySelector() inside the iframe.
Yet, when clicking the dark mode toggle button, it is affecting the first selector matching instead of the one inside the iframe.

Configuration:

export const parameters = {
  darkMode: {
    classTarget: 'html'
  }
};

DOM example:

  • html <-- this is the one that will have a class on it
    • iframe
      • html <-- this is the one that I expect to have a class on it

Due to this, the dark mode implementation of my components is not working.

@hipstersmoothie
Copy link
Owner

Want to submit a pr to fix?

@Iuriy-Budnikov
Copy link

I have the same issue

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

No branches or pull requests

3 participants