Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Add support for dark color scheme in default index.html page

Duncan Lock
August 15, 2021 01:42PM
# HG changeset patch
# User Duncan Lock <duncan.lock@gmail.com>
# Date 1629049097 25200
# Sun Aug 15 10:38:17 2021 -0700
# Node ID 945d9836012ed84dea05577027a30a38e38a59f3
# Parent dda421871bc213dd2eb3da0015d6228839323583
Add support for dark color scheme in default index & 50x pages

Add a meta tag to index.html & 50x.html to support dark color schemes.
This will display the index page in dark colors if the user has
requested a dark color scheme in their system UI or browser, and
display the same as the previous version if not.

This uses the browsers built-in styles and doesn't hard code any colors
or styles.

diff -r dda421871bc2 -r 945d9836012e docs/html/50x.html
--- a/docs/html/50x.html Tue Aug 10 23:43:17 2021 +0300
+++ b/docs/html/50x.html Sun Aug 15 10:38:17 2021 -0700
@@ -2,6 +2,7 @@
<html>
<head>
<title>Error</title>
+<meta name="color-scheme" content="light dark">
<style>
body {
width: 35em;
diff -r dda421871bc2 -r 945d9836012e docs/html/index.html
--- a/docs/html/index.html Tue Aug 10 23:43:17 2021 +0300
+++ b/docs/html/index.html Sun Aug 15 10:38:17 2021 -0700
@@ -2,6 +2,7 @@
<html>
<head>
<title>Welcome to nginx!</title>
+<meta name="color-scheme" content="light dark">
<style>
body {
width: 35em;

On Sun, 15 Aug 2021 at 00:05, Duncan Lock <duncan.lock@gmail.com> wrote:
>
> That seems like a much better approach - I'll submit a patch using
> this in the morning and see what people think.
>
> On Sat, 14 Aug 2021 at 23:00, Steffen Weber <steffen.weber@gmail.com> wrote:
> >
> > You could add the following line which makes modern browsers use colors from their built-in dark color scheme:
> >
> > <meta name="color-scheme" content="light dark">
> >
> > https://web.dev/color-scheme/
> >
> > Am So., 15. Aug. 2021 um 03:25 Uhr schrieb Maxim Dounin <mdounin@mdounin.ru>:
> >>
> >> Hello!
> >>
> >> On Sat, Aug 14, 2021 at 08:10:07AM -0700, Duncan Lock wrote:
> >>
> >> > # HG changeset patch
> >> > # User Duncan Lock <duncan.lock@gmail.com>
> >> > # Date 1628952253 25200
> >> > # Sat Aug 14 07:44:13 2021 -0700
> >> > # Node ID 81294b370e774c792210904f710abc0a494c5c05
> >> > # Parent dda421871bc213dd2eb3da0015d6228839323583
> >> > Add support for dark color scheme in default index.html page
> >> >
> >> > Add a little CSS to index.html to support dark color schemes.
> >> > This will display the index page in dark colors if the user has
> >> > requested a dark color scheme in their system UI or browser, and
> >> > display the same as the previous version if not.
> >> >
> >> > See: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
> >> >
> >> > diff -r dda421871bc2 -r 81294b370e77 docs/html/index.html
> >> > --- a/docs/html/index.html Tue Aug 10 23:43:17 2021 +0300
> >> > +++ b/docs/html/index.html Sat Aug 14 07:44:13 2021 -0700
> >> > @@ -8,6 +8,15 @@
> >> > margin: 0 auto;
> >> > font-family: Tahoma, Verdana, Arial, sans-serif;
> >> > }
> >> > + @media (prefers-color-scheme: dark) {
> >> > + body {
> >> > + background-color: #363839;
> >> > + color: #d1cec9;
> >> > + }
> >> > + a {
> >> > + color: #c4c4ff;
> >> > + }
> >> > + }
> >> > </style>
> >> > </head>
> >> > <body>
> >>
> >> Thank you for the patch. I don't think this is something we want
> >> to customize in the example pages such as index.html, especially
> >> given that we don't set other colors.
> >>
> >> --
> >> Maxim Dounin
> >> http://mdounin.ru/
> >> _______________________________________________
> >> nginx-devel mailing list
> >> nginx-devel@nginx.org
> >> http://mailman.nginx.org/mailman/listinfo/nginx-devel
> >
> > _______________________________________________
> > nginx-devel mailing list
> > nginx-devel@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-devel
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Add support for dark color scheme in default index.html page

Duncan Lock 274 August 14, 2021 11:12AM

Re: [PATCH] Add support for dark color scheme in default index.html page

Maxim Dounin 91 August 14, 2021 09:26PM

Re: [PATCH] Add support for dark color scheme in default index.html page

Steffen Weber 150 August 15, 2021 02:02AM

Re: [PATCH] Add support for dark color scheme in default index.html page

Duncan Lock 116 August 15, 2021 03:08AM

Re: [PATCH] Add support for dark color scheme in default index.html page

Duncan Lock 97 August 15, 2021 01:42PM

Re: [PATCH] Add support for dark color scheme in default index.html page

Maxim Dounin 103 August 15, 2021 09:22PM

Re: [PATCH] Add support for dark color scheme in default index.html page

Duncan Lock 90 August 15, 2021 10:50PM

Re: [PATCH] Add support for dark color scheme in default index.html page

Maxim Dounin 197 August 16, 2021 09:42AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready