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

Light/Dark Mode issues on older versions of Safari 12,13, and 14 #10074

Closed
2 of 7 tasks
eonarheim opened this issue Apr 25, 2024 · 3 comments
Closed
2 of 7 tasks

Light/Dark Mode issues on older versions of Safari 12,13, and 14 #10074

eonarheim opened this issue Apr 25, 2024 · 3 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: can't repro This bug is because of some local setup that can't be reproduced.

Comments

@eonarheim
Copy link

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Howdy! We are using docusaurus for the https://excaliburjs.com documentation site. Some of our users have reported issues with code snippets showing both the light and dark mode versions at the same time in older versions of safari. The docusaurus project is in the /site directory in the example link.

See issue excaliburjs/Excalibur#2981

image

With our investigation this seems to be because of the way that the :has pseudo class is used to show/hide the snippet. One possible fix is a simpler selector using backwards compatible css in docusaurus?

image

Reproducible demo

https://github.com/excaliburjs/Excalibur/tree/main/site

Steps to reproduce

  1. Run the docusaurus site locally https://github.com/excaliburjs/Excalibur/tree/main/site with npm run start
  2. On safari 12, 13, or 14 navigate to /docs/installation
  3. Observe the duplicated snippets for both light and dark mode
    image

Expected behavior

Either the light mode code snippet or the dark mode snippet should appear on older versions of safari (12, 13, 14)

Actual behavior

Both versions of the code snippet appear

Your environment

Self-service

  • I'd be willing to fix this bug myself.
@eonarheim eonarheim added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 25, 2024
@eonarheim
Copy link
Author

Oh we also tried a :has polyfill excaliburjs/Excalibur#3019

@slorber
Copy link
Collaborator

slorber commented Apr 25, 2024

Probably fixed in v3.1.1+ already, with #9530

Please upgrade your site before reporting bugs, or provide a runnable repro using the latest version. Otherwise, it's hard to inspect and we might spend time uselessly trying to fix a problem that is already fixed.

Note you choose to use Shiki Twoslash preset. It's not a plugin we maintain, we can only support you for code we maintain and it's possible that third-party packages have bugs too. Please provide a repro that only involves official packages.

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2024
@slorber slorber added closed: can't repro This bug is because of some local setup that can't be reproduced. and removed status: needs triage This issue has not been triaged by maintainers labels Apr 25, 2024
@eonarheim
Copy link
Author

I'll retest in that version to be sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: can't repro This bug is because of some local setup that can't be reproduced.
Projects
None yet
Development

No branches or pull requests

2 participants