Skip to content

Commit f17dbc6

Browse files
committed
fix
1 parent e0f1d2a commit f17dbc6

File tree

2 files changed

+88
-16
lines changed

2 files changed

+88
-16
lines changed

templates/development.css

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ body {
2727
color: var(--page-text-color);
2828
background: var(--page-bg-color);
2929
line-height: 1;
30-
display: none;
3130
}
3231

3332
ul {
@@ -37,9 +36,6 @@ ul {
3736

3837

3938
/* light theme */
40-
.light-theme {
41-
display: block;
42-
}
4339
:root {
4440
--page-bg-color: #fff;
4541
--page-text-color: #505050;
@@ -813,8 +809,6 @@ main {
813809
--button-color: #fff;
814810
--button-bg-hover: #5c636a;
815811
--button-color-hover: #fff;
816-
817-
display: block;
818812
}
819813

820814
.dark-theme header {
@@ -879,4 +873,80 @@ main {
879873
display: inline;
880874
}
881875

876+
@media (prefers-color-scheme: dark) {
877+
body:not(.light-theme) {
878+
--page-bg-color: rgba(46,46,46, 0.9);
879+
--page-text-color: #fff;
880+
--icon-color: #989898;
881+
--icon-hover-color: #fff;
882+
}
883+
884+
body:not(.light-theme) header {
885+
--header-bg-color: #2e2e2e;
886+
--previous-text-color: rgba(255, 255, 255, 0.8);
887+
--previous-arrow-color: #fff;
888+
}
889+
890+
body:not(.light-theme) .exception-card {
891+
--exception-card-bg-color: #222;
892+
--exception-card-border-color: #591e15;
893+
--exception-class-text-color: #fff;
894+
--exception-class-friendly-text-color: rgba(255, 255, 255, 0.5);
895+
--exception-class-friendly-link-color: #E57373;
896+
--exception-message-text-color: rgba(255, 255, 255, 0.8);
897+
}
898+
899+
body:not(.light-theme) header .solution {
900+
--text-color: rgba(255, 255, 255, 0.8);
901+
--link-color: #03a9f4;
902+
--link-hover-color: #39b9f3;
903+
--blockquote-text-color: #999;
904+
--blockquote-border-color: #484c50;
905+
--code-bg-color: #2d333b;
906+
--pre-bg-color: #2d333b;
907+
--table-border-color: #484c50;
908+
--separator-color: #484c50;
909+
}
910+
911+
body:not(.light-theme) .call-stack {
912+
--bg-color: #1e1e1e;
913+
--border-color: transparent;
914+
--box-shadow: 0 13px 20px rgba(0, 0, 0, 0.25);
915+
--link-color: rgba(255, 255, 255, 0.5);
916+
--error-line-bg-color: #422c2c;
917+
--hover-line-bg-color: #292929;
918+
--element-wrap-border-color: #141414;
919+
--element-wrap-text-color: #fff;
920+
--element-wrap-hover-text-color: #9cdcfe;
921+
--vendor-bg-color: rgba(46,46,46, 0.9);
922+
--vendor-border-color: #666;
923+
--vendor-state-bg-color: #666;
924+
--vendor-content-bg-color: rgba(46,46,46, 0.9);
925+
}
926+
927+
body:not(.light-theme) .functionArguments {
928+
--function-arguments-bg: #303030;
929+
--function-arguments-border-color: #272727;
930+
}
931+
body:not(.light-theme) .hljs {
932+
--hljs-text-color: #fff;
933+
--hljs-comment-text-color: #999;
934+
--hljs-keyword-text-color: #88aece;
935+
--hljs-attribute-text-color: #c59bc1;
936+
--hljs-name-text-color: #f08d49;
937+
--hljs-string-text-color: #b5bd68;
938+
--hljs-code-text-color: #cccccc;
939+
--hljs-delition-text-color: #de7176;
940+
--hljs-addition-text-color: #76c490;
941+
}
942+
943+
body:not(.light-theme) #dark-mode {
944+
display: none;
945+
}
946+
947+
body:not(.light-theme) #light-mode {
948+
display: inline;
949+
}
950+
}
951+
882952
/* end dark-theme */

templates/development.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737
<?= file_get_contents(__DIR__ . '/development.css') ?>
3838
</style>
3939
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700">
40+
<noscript>
41+
<style>
42+
.call-stack-vendor-items, .functionArguments {
43+
display: block !important;
44+
}
45+
.call-stack-vendor-collapse .flex-1 {
46+
display: none;
47+
}
48+
</style>
49+
</noscript>
4050
</head>
4151
<body<?= !empty($theme) ? " class=\"{$this->htmlEncode($theme)}\"" : '' ?>>
4252
<header>
@@ -365,20 +375,12 @@ function enableLightTheme() {
365375
document.onmousedown = function() { document.getElementsByTagName('body')[0].classList.add('mousedown'); }
366376
document.onmouseup = function() { document.getElementsByTagName('body')[0].classList.remove('mousedown'); }
367377

368-
const themeMedia = window.matchMedia('(prefers-color-scheme: dark)');
378+
<?php if (empty($theme)): ?>
369379
const theme = getCookie('yii-exception-theme');
370-
371380
if (theme) {
372381
applyTheme(theme);
373-
} else {
374-
applyTheme((themeMedia.matches ? DARK_THEME : LIGHT_THEME));
375382
}
376-
377-
themeMedia.addEventListener('change', event => {
378-
if (!theme) {
379-
applyTheme((event.matches ? DARK_THEME : LIGHT_THEME));
380-
}
381-
});
383+
<?php endif; ?>
382384

383385
function applyTheme(theme){
384386
document.body.classList.remove(DARK_THEME, LIGHT_THEME);

0 commit comments

Comments
 (0)