public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
* [PATCH olang v2] docs: add white mode support
@ 2024-02-17 18:29 Carlos Maniero
  2024-02-17 18:34 ` [olang/patches/.build.yml] build success builds.sr.ht
  2024-02-17 19:41 ` [PATCH olang v2] docs: add white mode support Johnny Richard
  0 siblings, 2 replies; 3+ messages in thread
From: Carlos Maniero @ 2024-02-17 18:29 UTC (permalink / raw)
  To: ~johnnyrichard/olang-devel; +Cc: Carlos Maniero

For accessibility reasons we now also support white mode.

Signed-off-by: Carlos Maniero <carlos@maniero.me>
---
v2:
  - Improve color contrast
  - Changes link color for white-mode

 docs/template.html | 110 +++++++++++++++++++++++++--------------------
 1 file changed, 61 insertions(+), 49 deletions(-)

diff --git a/docs/template.html b/docs/template.html
index 98cc348..2a1b721 100644
--- a/docs/template.html
+++ b/docs/template.html
@@ -1,55 +1,67 @@
 <!doctype html>
 <html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <meta name="date" content='$date-meta$'>
-    <title>$title$ | olang</title>
-    <style>
+<head>
+  <meta charset="utf-8">
+  <meta name="date" content='$date-meta$'>
+  <title>$title$ | olang</title>
+  <style>
+    :root {
+      --background-color: #f4f4f4;
+      --text-color: black;
+      --link-color: #4e5289;
+    }
+    @media (prefers-color-scheme: dark) {
       :root {
-        --background-color: #2e3533;
+        --background-color: #2b2b2b;
         --text-color: white;
+        --link-color: #8c91db;
       }
-      body {
-        background: #2e3533;
-        color: white;
-        font-family: monospace;
-        font-size: 1.1rem;
-        margin: 0;
-        padding: 0;
-      }
-      a {
-        color: #8c91db;
-      }
-      article, nav, header, footer {
-        max-width: 820px;
-        margin: 10px auto;
-      }
-      header, footer {
-        margin: 70px auto;
-      }
-      article {
-        line-height: 1.75rem;
-      }
-    </style>
-  </head>
-  <body>
-    <header>
-      <h1>∅lang | The zero programming language.</h1>
-      <nav>
-        <a href="/">Index</a> |
-        <a href="/pages/getting-started.html">Getting started (WIP)</a> |
-        <a href="/pages/hacking.html">Hacking (WIP)</a> |
-        <a href="https://sr.ht/~johnnyrichard/olang/sources" target="_blank">Sources ↗</a> |
-        <a href="https://sr.ht/~johnnyrichard/olang/lists" target="_blank">Mailing list ↗</a> 
-      </nav>
-    </header>
-    <article>
-      <h1>$title$</h1>
-
-      $body$
-    </article>
-    <footer>
-      © 2024 olang maintainers
-    </footer>
-  </body>
+    }
+    body {
+      background: var(--background-color);
+      color: var(--text-color);
+      font-family: monospace;
+      font-size: 1.1rem;
+      margin: 0;
+      padding: 0;
+    }
+    a {
+      color: var(--link-color);
+    }
+    article, nav, header, footer {
+      max-width: 820px;
+      margin: 10px auto;
+    }
+    header, footer {
+      margin: 70px auto;
+    }
+    article {
+      line-height: 1.75rem;
+    }
+    pre {
+      background: rgba(0,0,0, 0.75);
+      color: white;
+      padding: 10px;
+    }
+  </style>
+</head>
+<body>
+  <header>
+    <h1>∅lang | The zero programming language</h1>
+    <nav>
+      <a href="/">Index</a> |
+      <a href="/pages/getting-started.html">Getting started (WIP)</a> |
+      <a href="/pages/hacking.html">Hacking (WIP)</a> |
+      <a href="https://sr.ht/~johnnyrichard/olang/sources" target="_blank">Sources ↗</a> |
+      <a href="https://sr.ht/~johnnyrichard/olang/lists" target="_blank">Mailing list ↗</a>
+    </nav>
+  </header>
+  <article>
+    <h1>$title$</h1>
+    $body$
+  </article>
+  <footer>
+    © 2024 olang maintainers
+  </footer>
+</body>
 </html>
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [olang/patches/.build.yml] build success
  2024-02-17 18:29 [PATCH olang v2] docs: add white mode support Carlos Maniero
@ 2024-02-17 18:34 ` builds.sr.ht
  2024-02-17 19:41 ` [PATCH olang v2] docs: add white mode support Johnny Richard
  1 sibling, 0 replies; 3+ messages in thread
From: builds.sr.ht @ 2024-02-17 18:34 UTC (permalink / raw)
  To: Carlos Maniero; +Cc: ~johnnyrichard/olang-devel

olang/patches/.build.yml: SUCCESS in 17s

[docs: add white mode support][0] v2 from [Carlos Maniero][1]

[0]: https://lists.sr.ht/~johnnyrichard/olang-devel/patches/49604
[1]: mailto:carlos@maniero.me

✓ #1152150 SUCCESS olang/patches/.build.yml https://builds.sr.ht/~johnnyrichard/job/1152150

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH olang v2] docs: add white mode support
  2024-02-17 18:29 [PATCH olang v2] docs: add white mode support Carlos Maniero
  2024-02-17 18:34 ` [olang/patches/.build.yml] build success builds.sr.ht
@ 2024-02-17 19:41 ` Johnny Richard
  1 sibling, 0 replies; 3+ messages in thread
From: Johnny Richard @ 2024-02-17 19:41 UTC (permalink / raw)
  To: Carlos Maniero; +Cc: ~johnnyrichard/olang-devel

Thanks! applied.

To git.sr.ht:~johnnyrichard/olang
   6b0363a..f24d93f  main -> main


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-17 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-17 18:29 [PATCH olang v2] docs: add white mode support Carlos Maniero
2024-02-17 18:34 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-02-17 19:41 ` [PATCH olang v2] docs: add white mode support Johnny Richard

Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox