diff --git a/docs/utils.mdx b/docs/utils.mdx index 6d1470eb2..d4e40135b 100644 --- a/docs/utils.mdx +++ b/docs/utils.mdx @@ -5,6 +5,8 @@ title: Markdown Examples import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; +import useBaseUrl from "@docusaurus/useBaseUrl"; +import ThemedImage from "@theme/ThemedImage"; ## Base Syntax @@ -265,21 +267,46 @@ $$ |x| = \begin{Bmatrix} x & {if } x \geq 0 \\ -x & {if } x < 0 \end{Bmatrix} $$ -### YouTube Embed +## Themed Images -## First Version +### First Version + +Image path should include `#gh-light-mode-only` for the Light Theme and `#gh-dark-mode-only` for the Dark Theme + +![Docusaurus themed image](/img/logo.svg#gh-light-mode-only)![Docusaurus themed image](/img/logo_dark.svg#gh-dark-mode-only) + +### Second Version + +Must Include + +```jsx +import useBaseUrl from "@docusaurus/useBaseUrl"; +import ThemedImage from "@theme/ThemedImage"; +``` + + + +## YouTube Embed + +### First Version [![Blockchain basics](https://img.youtube.com/vi/tv6OBimIX98/maxresdefault.jpg)](https://www.youtube.com/watch?v=tv6OBimIX98 "Blockchain basics") -## Second version +### Second version ## Mermaid diagrams diff --git a/src/css/custom.css b/src/css/custom.css index aae8ac5c0..1139b1eda 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -621,3 +621,12 @@ table > tfoot:not(:last-child) { } /* -------------------- End Mermaid ------------------- */ + +/* ------------------- Start Dynamic Theme Support ------------------- */ + +[data-theme="light"] img[src$="#gh-dark-mode-only"], +[data-theme="dark"] img[src$="#gh-light-mode-only"] { + display: none; +} + +/* -------------------- End Dynamic Theme Support ------------------- */