Skip to content

Commit d9c49ae

Browse files
authored
Improve contrast for dark mode phpinfo (#8893)
Also use CSS variable names; all browsers I can find that support the prefers-color-scheme media query also support CSS variables. Someone voiced they didn't want the background texture that php.net has, so I did not include that.
1 parent b22d2bf commit d9c49ae

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

ext/standard/css.c

+12-8
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,17 @@ PHPAPI ZEND_COLD void php_info_print_css(void) /* {{{ */
3838
PUTS(".v i {color: #999;}\n");
3939
PUTS("img {float: right; border: 0;}\n");
4040
PUTS("hr {width: 934px; background-color: #ccc; border: 0; height: 1px;}\n");
41-
PUTS("@media (prefers-color-scheme: dark) {\n");
42-
PUTS(" body {background-color: #333; color: #ddd;}\n");
43-
PUTS(" td, th {border-color: #777;}\n");
44-
PUTS(" .e {background-color: #4F5B93;}\n");
45-
PUTS(" .h {background-color: #5b69a6;}\n");
46-
PUTS(" .v {background-color: #444;}\n");
47-
PUTS(" hr {background-color: #777;}\n");
48-
PUTS("}\n");
41+
PUTS(":root {--php-dark-grey: #333; --php-dark-blue: #4F5B93; --php-medium-blue: #8892BF; --php-light-blue: #E2E4EF; --php-accent-purple: #793862}");
42+
PUTS(
43+
"@media (prefers-color-scheme: dark) {\n"
44+
" body {background: var(--php-dark-grey); color: var(--php-light-blue)}\n"
45+
" .h td, td.e, th {border-color: #606A90}\n"
46+
" td {border-color: #505153}\n"
47+
" .e {background-color: #404A77}\n"
48+
" .h {background-color: var(--php-dark-blue)}\n"
49+
" .v {background-color: var(--php-dark-grey)}\n"
50+
" hr {background-color: #505153}\n"
51+
"}\n"
52+
);
4953
}
5054
/* }}} */

0 commit comments

Comments
 (0)