joeyespo / grip

Preview GitHub README.md files locally before committing them.
MIT License
6.42k stars 422 forks source link

add theme argument to view in dark mode or light mode #374

Closed anhtumai closed 9 months ago

anhtumai commented 1 year ago

Theme is option to view mark down file, in light mode or dark mode. Fix https://github.com/joeyespo/grip/issues/358

anhtumai commented 1 year ago

@joeyespo This is ready for review

anhtumai commented 1 year ago

Explanation for this PR:

At the time this PR is created, GitHub uses dark-color-mode, data-light-theme, and data-dark-theme parameters in html tag to specify the theme of the website. This feature is not in any documentation, as far as I know.

image

In dark mode, these values are data-color-mode: dark, data-light-theme: light, and data-dark-theme: dark In light mode, these values are data-color-mode: light, data-light-theme: light, and data-dark-theme: dark

Additional benefit

I checked the HTML content of the GitHub website and saw that its styling depends on these parameters.

image

Therefore, even if we don't need dark mode, adding these parameters above to the html tag in our generated HTML file will make the output website prettier and more like GitHub.

What I do in this PR

Potato22 commented 10 months ago

Any updates on this getting pulled anytime soon?

claudio-ebel commented 9 months ago

After fiddling around over an hour with the standard installation, I

joeyespo commented 9 months ago

Looks good! Thank you for the PR, @anhtumai!

I'll comment back here once a new release is out.

Potato22 commented 9 months ago

oh my gosh finally!!