squidfunk / mkdocs-material

Documentation that simply works

Home Page:https://squidfunk.github.io/mkdocs-material/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Giscus theme inconsistency

sechurity opened this issue · comments

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

The original documentation's template code on integrating Giscus sets the page to a default theme (according to the value of data-theme of the GIscus code snippet) instead of light theme if the page is first loaded in light mode.

Expected behaviour

When the page is first loaded in light mode (color scheme is not slate), the comment section powered by Giscus is light theme. Like in the screenshot below.
image

Actual behaviour

When the page is first loaded in light mode (color scheme is not slate), the comment section powered by Giscus is the default theme according to the value of data-theme of the GIscus code snippet .

<script src="https://giscus.app/client.js"
        data-repo="[ENTER REPO HERE]"
        data-repo-id="[ENTER REPO ID HERE]"
        data-category="[ENTER CATEGORY NAME HERE]"
        data-category-id="[ENTER CATEGORY ID HERE]"
        data-mapping="pathname"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="bottom"
        data-theme="transparent_dark"
        data-lang="en"
        crossorigin="anonymous"
        async>
</script>

Like in the screenshot below.
image

Steps to reproduce

  1. Set the page to light mode either by toggling the switch of an existing page or by using system settings
  2. Visit the page in a new window

Package versions

N/A

Configuration

N/A

System information

Tested on:

  • Operating system: Fedora Workstation 36
  • Browser: Firefox

Thanks for reporting and providing the details as requested in #4059. Since this is a pure documentation issue, merging the PR closes it.