nilsnolde / wordpress-markdown-git

:loop: WordPress plugin to add file content (Markdown, Jupyter notebooks) from a Git based VCS to a WordPress post; replaces https://github.com/gis-ops/md-github-wordpress
GNU General Public License v3.0
48 stars 14 forks source link

plugin does not respect dark mode #21

Closed noah1510 closed 3 years ago

noah1510 commented 3 years ago

Versions Wordpress: 5.6 Documents for Git: 1.1.0

Describe the bug The text color is not aware of the dark mode (theme twenty-one) and stays black instead of being white (like the default text does)

Paste the shortcode and the censored contents of config.json config.json is the default file with github access token. shortcode

[git-github-markdown url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]

To Reproduce Steps to reproduce the behavior:

  1. Select theme twenty-one
  2. Add shortcode
  3. turn the dark mode on
  4. enjoy not being able to read anything

Expected behavior The text should turn into a bright color to make it readable on a dark background like it does on github.

Screenshots Dark mode on: image

Dark mode off: image

nilsnolde commented 3 years ago

Ugh, yeah, that's not really nice. However, I'll pass the cup further down: https://github.com/sindresorhus/github-markdown-css/issues/76 (who also does the same with another of his projects;))

And I can also only repeat what he's saying: not planning to work on supporting that, as it's not important for us. But PR's will be welcomingly discussed and merged.

nilsnolde commented 3 years ago

BTW @noah1510 , there's a tiny fork which should do what you want: https://github.com/hyrious/github-markdown-css

If you replace this file https://github.com/gis-ops/wordpress-markdown-git/blob/master/documents-git/css/github-markdown.css with the one from the fork, it might just work!

If you try it out, please leave feedback here. Then I can just test from my side if it doesn't screw up our case and merge.

noah1510 commented 3 years ago

I just tried using the fork and everything looked exactly the same. I guess that could be expected, since the fork only adds support for dark mode and does not change any of the old style. So in addition to using the fork, there need to be some changes on the plugin to select the dark mode classes when wordpress uses the dark mode.

nilsnolde commented 3 years ago

This got merged finally upstream: https://github.com/sindresorhus/github-markdown-css/issues/76

I tried to find out how WP toggles dark mode, but it seems to be theme-specific. I couldn’t find any sort of API in WP that toggles it. We can’t solve theme-specific stuff here I’m afraid..