diff options
author | 2024-01-28 21:03:12 +0800 | |
---|---|---|
committer | 2024-01-28 21:03:12 +0800 | |
commit | b73ba227af0a73f3cd0eb8ef1977ca624d953239 (patch) | |
tree | 99a1b09ee0c98c0f11abf919afca1fea45e2c1bd /pydis_site/apps/content | |
parent | Merge pull request #1211 from python-discord/dependabot/pip/ruff-0.1.14 (diff) |
Add section about dark mode in guide for contributing a page
Diffstat (limited to 'pydis_site/apps/content')
-rw-r--r-- | pydis_site/apps/content/resources/guides/pydis-guides/how-to-contribute-a-page.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/how-to-contribute-a-page.md b/pydis_site/apps/content/resources/guides/pydis-guides/how-to-contribute-a-page.md index 65a402fd..f1ef7d29 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/how-to-contribute-a-page.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/how-to-contribute-a-page.md @@ -85,6 +85,30 @@ Pages, which include guides, articles, and other static content,... - **toc:** A number representing the smallest heading tag to show in the table of contents. See: [Table of Contents](#table-of-contents) + +## Working with dark mode + +If your article includes images, you can apply a few classes for a better experience for readers using dark mode. + +### Add a white background to an image + +Use the `has-dark-mode-background` class to apply a white background to your image, so it can be read easily in dark mode. + +```md +{: class="has-dark-mode-background" } +``` + +### Alternate images for each mode + +If you can provide two images, suited for each of the light and dark modes specifically, you can use the `light-image` and `dark-image` classes to have the correct image be used depending on the mode. + +```md +{: class="light-image" } +{: class="dark-image" } +``` + +This way, when the reader is in light mode, only `image_light.png` is shown, and when the reader is in dark mode, only `image_dark.png` is shown. + ## Extended Markdown Apart from standard Markdown, certain additions are available: |