-
-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support multiple themes for
renderToHtmlDualThemes
- Loading branch information
Showing
8 changed files
with
223 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
<style> | ||
.shiki { | ||
padding: 0.5em; | ||
border-radius: 0.25em; | ||
} | ||
|
||
[data-theme="dark"] .shiki { | ||
background-color: var(--s-dark-bg) !important; | ||
color: var(--s-dark) !important; | ||
} | ||
[data-theme="dark"] .shiki span { | ||
color: var(--s-dark) !important; | ||
} | ||
|
||
[data-theme="nord"] .shiki { | ||
background-color: var(--s-nord-bg) !important; | ||
color: var(--s-nord) !important; | ||
} | ||
[data-theme="nord"] .shiki span { | ||
color: var(--s-nord) !important; | ||
} | ||
|
||
[data-theme="min-dark"] .shiki { | ||
background-color: var(--s-min-dark-bg) !important; | ||
color: var(--s-min-dark) !important; | ||
} | ||
[data-theme="min-dark"] .shiki span { | ||
color: var(--s-min-dark) !important; | ||
} | ||
|
||
[data-theme="min-light"] .shiki { | ||
background-color: var(--s-min-light-bg) !important; | ||
color: var(--s-min-light) !important; | ||
} | ||
[data-theme="min-light"] .shiki span { | ||
color: var(--s-min-light) !important; | ||
} | ||
</style> | ||
<script> | ||
const themes = ['light', 'dark', 'nord', 'min-dark', 'min-light'] | ||
|
||
function toggleTheme() { | ||
document.body.dataset.theme = themes[(Math.max(themes.indexOf(document.body.dataset.theme), 0) + 1) % themes.length] | ||
} | ||
</script> | ||
<button onclick="toggleTheme()">Toggle theme</button> | ||
<pre class="shiki shiki-dual-themes vitesse-light vitesse-dark nord min-dark min-light" style="background-color: #ffffff;--s-dark-bg:#121212;--s-nord-bg:#2e3440ff;--s-min-dark-bg:#1f1f1f;--s-min-light-bg:#ffffff; color: #ffffff;--s-dark-bg:#121212;--s-nord-bg:#2e3440ff;--s-min-dark-bg:#1f1f1f;--s-min-light-bg:#ffffff" tabindex="0"><code><span class="line"><span style="color: #B07D48;--s-dark:#BD976A;--s-nord:#D8DEE9;--s-min-dark:#79B8FF;--s-min-light:#1976D2">console</span><span style="color: #999999;--s-dark:#666666;--s-nord:#ECEFF4;--s-min-dark:#B392F0;--s-min-light:#6F42C1">.</span><span style="color: #59873A;--s-dark:#80A665;--s-nord:#88C0D0;--s-min-dark:#B392F0;--s-min-light:#6F42C1">log</span><span style="color: #999999;--s-dark:#666666;--s-nord:#D8DEE9FF;--s-min-dark:#B392F0;--s-min-light:#24292EFF">(</span><span style="color: #B5695999;--s-dark:#C98A7D99;--s-nord:#ECEFF4;--s-min-dark:#FFAB70;--s-min-light:#22863A">"</span><span style="color: #B56959;--s-dark:#C98A7D;--s-nord:#A3BE8C;--s-min-dark:#FFAB70;--s-min-light:#22863A">hello</span><span style="color: #B5695999;--s-dark:#C98A7D99;--s-nord:#ECEFF4;--s-min-dark:#FFAB70;--s-min-light:#22863A">"</span><span style="color: #999999;--s-dark:#666666;--s-nord:#D8DEE9FF;--s-min-dark:#B392F0;--s-min-light:#24292EFF">)</span></span></code></pre> |