You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this way of doing things part of the public API? Or in other words, can I rely on this behavior?
Motivation
Some plugins need to know this.
Example: kamiazya/typedoc-plugin-mermaid#456. This plugin renders Mermaid graphs in comments. Mermaid always renders graphs into a standalone SVG with a specific Mermaid theme backed in. My idea is to render two versions of the same graph (one for dark mode and one for light mode) and use CSS to switch between the two (making it so that only one of them is visible at a time depending on dark mode). However, I need a CSS way for detecting light/dark mode to do that.
The text was updated successfully, but these errors were encountered:
I need 2 copies of all variable assignments per color scheme.
I wonder if you could get rid of the @media queries that cause this code duplication. Couldn't we assign data-theme before the <body> loads using a little script in <head> like this:
Search terms
theme, API, dark, light
Question
Currently, selecting the dark, light, or OS theme is done by adding special classes (
dark
orlight
) to the<body>
and by using@media
queries if those special classes aren't present.Is this way of doing things part of the public API? Or in other words, can I rely on this behavior?
Motivation
Some plugins need to know this.
Example: kamiazya/typedoc-plugin-mermaid#456. This plugin renders Mermaid graphs in comments. Mermaid always renders graphs into a standalone SVG with a specific Mermaid theme backed in. My idea is to render two versions of the same graph (one for dark mode and one for light mode) and use CSS to switch between the two (making it so that only one of them is visible at a time depending on dark mode). However, I need a CSS way for detecting light/dark mode to do that.
The text was updated successfully, but these errors were encountered: