Skip to content

Commit b0656ae

Browse files
author
Will Fris
committed
Use prefered color scheme on webserver error pages
1 parent b50f86e commit b0656ae

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

sapi/cli/php_cli_server.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,26 +240,46 @@ ZEND_DECLARE_MODULE_GLOBALS(cli_server)
240240
* copied from ext/standard/info.c
241241
*/
242242
static const char php_cli_server_css[] = "<style>" \
243+
":root{" \
244+
"--c-black:#000000;" \
245+
"--c-dark-grey:#333333;" \
246+
"--c-lavender-misty:#E2E4EF;" \
247+
"--c-blue-bell:#9999CC;" \
248+
"--c-white:#FCFCFC;" \
249+
"--php-background:light-dark(" \
250+
"var(--c-white),var(--c-dark-grey)" \
251+
");" \
252+
"--php-code-background:var(--c-lavender-misty);" \
253+
"--php-code-foreground:var(--c-black);" \
254+
"--php-foreground:light-dark(" \
255+
"var(--c-dark-grey),var(--c-lavender-misty)" \
256+
");" \
257+
"--php-heading-background:var(--c-blue-bell);" \
258+
"--php-heading-foreground:var(--c-black);" \
259+
"color-scheme:light dark;" \
260+
"}" \
243261
"body{" \
244-
"background-color:#fcfcfc;" \
245-
"color:#333333;" \
262+
"background-color:var(--php-background);" \
263+
"color:var(--php-foreground);" \
246264
"margin:0;" \
247265
"padding:0;" \
248266
"}" \
249267
"h1{" \
250268
"font-size:1.5em;" \
251269
"font-weight:normal;" \
252-
"background-color:#9999cc;" \
270+
"background-color:var(--php-heading-background);" \
271+
"color:var(--php-heading-foreground);" \
253272
"min-height:2em;" \
254273
"line-height:2em;" \
255-
"border-bottom:1px inset black;" \
274+
"border-bottom:1px inset var(--php-black);" \
256275
"margin:0;" \
257276
"}" \
258277
"h1,p{" \
259278
"padding-left:10px;" \
260279
"}" \
261280
"code.url{" \
262-
"background-color:#eeeeee;" \
281+
"background-color:var(--php-code-background);" \
282+
"color:var(--php-code-foreground);" \
263283
"font-family:monospace;" \
264284
"padding:0 2px;" \
265285
"}" \

0 commit comments

Comments
 (0)