ssh git@grit.deadkey.org man

Commit c106f4a h

Pat Ambrosio · 26-09-04 23:35

Set the theme control in the contrast mark, and at a readable size

Changes: 5 files +38 -14

Changes (Side-by-Side)

share/jenny/layout/404.sh +8 -3

cat << _EOF_
78 background: none; 78 background: none;
79 border: 1px solid var(--border); 79 border: 1px solid var(--border);
80 color: var(--text-primary); 80 color: var(--text-primary);
81 padding: .4em .6em;
81 /* A geometric glyph reads smaller than a letter set at the same size,
82 and .9em left the control noticeably small against the type it
83 sits beside. Padding is square so the button does not come out
84 wider than it is tall around a round mark. */
85 padding: .35em .45em;
82 cursor: pointer; 86 cursor: pointer;
83 font-size: .9em;
87 font-size: 1.15em;
88 line-height: 1;
84 text-decoration: none; 89 text-decoration: none;
85 text-transform: uppercase; 90 text-transform: uppercase;
86 } 91 }
cat << _EOF_
123 </script> 128 </script>
124 </head> 129 </head>
125 <body> 130 <body>
126 <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x263C;&#xFE0E;</a>
131 <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x25D0;&#xFE0E;</a>
127 <header><a href="/">$(html_escape "${BLOG_TITLE:-}")</a></header> 132 <header><a href="/">$(html_escape "${BLOG_TITLE:-}")</a></header>
128 <div class="notfound"> 133 <div class="notfound">
129 <p class="code">404</p> 134 <p class="code">404</p>

share/jenny/layout/index.sh +8 -3

cat << _EOF_
210 background: none; 210 background: none;
211 border: 1px solid var(--border); 211 border: 1px solid var(--border);
212 color: var(--text-primary); 212 color: var(--text-primary);
213 padding: .4em .6em;
213 /* A geometric glyph reads smaller than a letter set at the same size,
214 and .9em left the control noticeably small against the type it
215 sits beside. Padding is square so the button does not come out
216 wider than it is tall around a round mark. */
217 padding: .35em .45em;
214 cursor: pointer; 218 cursor: pointer;
215 font-size: .9em;
219 font-size: 1.15em;
220 line-height: 1;
216 text-decoration: none; 221 text-decoration: none;
217 text-transform: uppercase; 222 text-transform: uppercase;
218 } 223 }
cat << _EOF_
254 </script> 259 </script>
255 </head> 260 </head>
256 <body> 261 <body>
257 <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x263C;&#xFE0E;</a>
262 <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x25D0;&#xFE0E;</a>
258 <header><a href="$URL_PREFIX/"$([ -z "${TAGNAME:-}" ] && [ -z "${PAGE_NUM:-}" ] && echo ' class="current"')>$(html_escape "${BLOG_TITLE:-}")</a> 263 <header><a href="$URL_PREFIX/"$([ -z "${TAGNAME:-}" ] && [ -z "${PAGE_NUM:-}" ] && echo ' class="current"')>$(html_escape "${BLOG_TITLE:-}")</a>
259 $(if [ "${TAGNAME:-}" ]; then echo "&#x2192;&#xFE0E; TAG: <a href=\"$URL_PREFIX/tag/$TAGNAME/\"$([ -z "${PAGE_NUM:-}" ] && echo ' class="current"')>$(html_escape "${TAGNAME:-}")</a>"; fi) 264 $(if [ "${TAGNAME:-}" ]; then echo "&#x2192;&#xFE0E; TAG: <a href=\"$URL_PREFIX/tag/$TAGNAME/\"$([ -z "${PAGE_NUM:-}" ] && echo ' class="current"')>$(html_escape "${TAGNAME:-}")</a>"; fi)
260 $(if [ "${PAGE_NUM:-}" ]; then echo "&#x2192;&#xFE0E; <a href=\"$URL_PREFIX$([ -n "${TAGNAME:-}" ] && echo "/tag/$TAGNAME")/page/$PAGE_NUM.html\" class=\"current\">Page $PAGE_NUM</a>"; fi) 265 $(if [ "${PAGE_NUM:-}" ]; then echo "&#x2192;&#xFE0E; <a href=\"$URL_PREFIX$([ -n "${TAGNAME:-}" ] && echo "/tag/$TAGNAME")/page/$PAGE_NUM.html\" class=\"current\">Page $PAGE_NUM</a>"; fi)

share/jenny/layout/page.sh +8 -3

cat << _EOF_
1041 background: none; 1041 background: none;
1042 border: 1px solid var(--border-breadcrumb); 1042 border: 1px solid var(--border-breadcrumb);
1043 color: var(--text-primary); 1043 color: var(--text-primary);
1044 padding: .4em .6em;
1044 /* A geometric glyph reads smaller than a letter set at the same size,
1045 and .9em left the control noticeably small against the type it
1046 sits beside. Padding is square so the button does not come out
1047 wider than it is tall around a round mark. */
1048 padding: .35em .45em;
1045 cursor: pointer; 1049 cursor: pointer;
1046 font-size: .9em;
1050 font-size: 1.15em;
1051 line-height: 1;
1047 text-decoration: none; 1052 text-decoration: none;
1048 text-transform: uppercase; 1053 text-transform: uppercase;
1049 } 1054 }
cat << _EOF_
1444 </script> 1449 </script>
1445 </head> 1450 </head>
1446 <body> 1451 <body>
1447 <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x263C;&#xFE0E;</a>
1452 <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x25D0;&#xFE0E;</a>
1448 <header><a href="$URL_PREFIX/"$([ -z "${PAGE_CRUMBS:-}" ] && echo ' class="current"')>$(html_escape "${BLOG_TITLE:-}")</a>$(crumbs)</header> 1453 <header><a href="$URL_PREFIX/"$([ -z "${PAGE_CRUMBS:-}" ] && echo ' class="current"')>$(html_escape "${BLOG_TITLE:-}")</a>$(crumbs)</header>
1449 <article> 1454 <article>
1450 <div class="page-wrapper"> 1455 <div class="page-wrapper">

share/jenny/layout/post.sh +8 -3

cat << _EOF_
862 background: none; 862 background: none;
863 border: 1px solid var(--border-light); 863 border: 1px solid var(--border-light);
864 color: var(--text-primary); 864 color: var(--text-primary);
865 padding: .4em .6em;
865 /* A geometric glyph reads smaller than a letter set at the same size,
866 and .9em left the control noticeably small against the type it
867 sits beside. Padding is square so the button does not come out
868 wider than it is tall around a round mark. */
869 padding: .35em .45em;
866 cursor: pointer; 870 cursor: pointer;
867 font-size: .9em;
871 font-size: 1.15em;
872 line-height: 1;
868 text-decoration: none; 873 text-decoration: none;
869 text-transform: uppercase; 874 text-transform: uppercase;
870 } 875 }
cat << _EOF_
1216 </script> 1221 </script>
1217 </head> 1222 </head>
1218 <body> 1223 <body>
1219 <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x263C;&#xFE0E;</a>
1224 <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x25D0;&#xFE0E;</a>
1220 <!-- No breadcrumb on a post. Its own segment would be the slug, which 1225 <!-- No breadcrumb on a post. Its own segment would be the slug, which
1221 usually restates the title sitting directly beneath it -- and making 1226 usually restates the title sitting directly beneath it -- and making
1222 that read well would mean choosing titles that differ from their 1227 that read well would mean choosing titles that differ from their

test/regressions.sh +6 -2

assert_file_contains "$dm/.dist/index.html" 'class="theme-toggle"'
2079 assert_file_contains "$dm/.dist/index.html" 'aria-label="Toggle dark mode"' 2079 assert_file_contains "$dm/.dist/index.html" 'aria-label="Toggle dark mode"'
2080 2080
2081 it "the toggle button uses an entity glyph, not raw Unicode" 2081 it "the toggle button uses an entity glyph, not raw Unicode"
2082 assert_file_not_contains "$dm/.dist/index.html" '☀'
2083 assert_file_contains "$dm/.dist/index.html" '&#x263C;&#xFE0E;'
2082 # U+25D0, the half-filled circle that conventionally means contrast. The
2083 # variation selector matters as much as the codepoint: without &#xFE0E; a
2084 # platform is free to render the mark as a colour emoji, which is not what a
2085 # control set in the page's own type should look like.
2086 assert_file_not_contains "$dm/.dist/index.html" '◐'
2087 assert_file_contains "$dm/.dist/index.html" '&#x25D0;&#xFE0E;'
2084 2088
2085 it "the theme script applies data-theme and uses localStorage" 2089 it "the theme script applies data-theme and uses localStorage"
2086 assert_file_contains "$dm/.dist/index.html" 'data-theme' 2090 assert_file_contains "$dm/.dist/index.html" 'data-theme'

Raw

commit c106f4a10a5aa6d4807b73b48b9c54561d27b67e
Author: Pat Ambrosio <cp.ambrosio@gmail.com>
Date:   Fri Sep 4 23:35:02 2026 +0800

    Set the theme control in the contrast mark, and at a readable size
    
    The sun stood for one of the two states rather than for the choice
    between them; U+25D0, the half-filled circle, is the mark that
    conventionally means contrast. The variation selector stays: without
    &#xFE0E; a platform may render the glyph as a colour emoji, which is not
    what a control set in the page's own type should look like.
    
    It was also genuinely small, not a stale stylesheet -- .9em is 14.4px
    against a 16px body, and a geometric glyph reads smaller than a letter
    set at the same size. 1.15em with line-height 1, and the padding squared
    so the button does not come out wider than it is tall around a round
    mark. All four layouts carry the control and all four are changed.

diff --git a/share/jenny/layout/404.sh b/share/jenny/layout/404.sh
index efd2cae..bb98ae7 100755
--- a/share/jenny/layout/404.sh
+++ b/share/jenny/layout/404.sh
@@ -78,9 +78,14 @@ cat << _EOF_
         background: none;
         border: 1px solid var(--border);
         color: var(--text-primary);
-        padding: .4em .6em;
+        /* A geometric glyph reads smaller than a letter set at the same size,
+           and .9em left the control noticeably small against the type it
+           sits beside. Padding is square so the button does not come out
+           wider than it is tall around a round mark. */
+        padding: .35em .45em;
         cursor: pointer;
-        font-size: .9em;
+        font-size: 1.15em;
+        line-height: 1;
         text-decoration: none;
         text-transform: uppercase;
       }
@@ -123,7 +128,7 @@ cat << _EOF_
     </script>
   </head>
   <body>
-    <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x263C;&#xFE0E;</a>
+    <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x25D0;&#xFE0E;</a>
     <header><a href="/">$(html_escape "${BLOG_TITLE:-}")</a></header>
     <div class="notfound">
       <p class="code">404</p>
diff --git a/share/jenny/layout/index.sh b/share/jenny/layout/index.sh
index 6e3c218..68f1faf 100755
--- a/share/jenny/layout/index.sh
+++ b/share/jenny/layout/index.sh
@@ -210,9 +210,14 @@ cat << _EOF_
         background: none;
         border: 1px solid var(--border);
         color: var(--text-primary);
-        padding: .4em .6em;
+        /* A geometric glyph reads smaller than a letter set at the same size,
+           and .9em left the control noticeably small against the type it
+           sits beside. Padding is square so the button does not come out
+           wider than it is tall around a round mark. */
+        padding: .35em .45em;
         cursor: pointer;
-        font-size: .9em;
+        font-size: 1.15em;
+        line-height: 1;
         text-decoration: none;
         text-transform: uppercase;
       }
@@ -254,7 +259,7 @@ cat << _EOF_
     </script>
   </head>
   <body>
-    <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x263C;&#xFE0E;</a>
+    <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x25D0;&#xFE0E;</a>
     <header><a href="$URL_PREFIX/"$([ -z "${TAGNAME:-}" ] && [ -z "${PAGE_NUM:-}" ] && echo ' class="current"')>$(html_escape "${BLOG_TITLE:-}")</a>
       $(if [ "${TAGNAME:-}" ]; then echo "&#x2192;&#xFE0E; TAG: <a href=\"$URL_PREFIX/tag/$TAGNAME/\"$([ -z "${PAGE_NUM:-}" ] && echo ' class="current"')>$(html_escape "${TAGNAME:-}")</a>"; fi)
       $(if [ "${PAGE_NUM:-}" ]; then echo "&#x2192;&#xFE0E; <a href=\"$URL_PREFIX$([ -n "${TAGNAME:-}" ] && echo "/tag/$TAGNAME")/page/$PAGE_NUM.html\" class=\"current\">Page $PAGE_NUM</a>"; fi)
diff --git a/share/jenny/layout/page.sh b/share/jenny/layout/page.sh
index f3fb1b2..54ea40a 100755
--- a/share/jenny/layout/page.sh
+++ b/share/jenny/layout/page.sh
@@ -1041,9 +1041,14 @@ cat << _EOF_
           background: none;
           border: 1px solid var(--border-breadcrumb);
           color: var(--text-primary);
-          padding: .4em .6em;
+          /* A geometric glyph reads smaller than a letter set at the same size,
+             and .9em left the control noticeably small against the type it
+             sits beside. Padding is square so the button does not come out
+             wider than it is tall around a round mark. */
+          padding: .35em .45em;
           cursor: pointer;
-          font-size: .9em;
+          font-size: 1.15em;
+          line-height: 1;
           text-decoration: none;
           text-transform: uppercase;
         }
@@ -1444,7 +1449,7 @@ cat << _EOF_
       </script>
     </head>
     <body>
-      <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x263C;&#xFE0E;</a>
+      <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x25D0;&#xFE0E;</a>
       <header><a href="$URL_PREFIX/"$([ -z "${PAGE_CRUMBS:-}" ] && echo ' class="current"')>$(html_escape "${BLOG_TITLE:-}")</a>$(crumbs)</header>
       <article>
         <div class="page-wrapper">
diff --git a/share/jenny/layout/post.sh b/share/jenny/layout/post.sh
index 42d9f1e..dd2f46c 100755
--- a/share/jenny/layout/post.sh
+++ b/share/jenny/layout/post.sh
@@ -862,9 +862,14 @@ cat << _EOF_
           background: none;
           border: 1px solid var(--border-light);
           color: var(--text-primary);
-          padding: .4em .6em;
+          /* A geometric glyph reads smaller than a letter set at the same size,
+             and .9em left the control noticeably small against the type it
+             sits beside. Padding is square so the button does not come out
+             wider than it is tall around a round mark. */
+          padding: .35em .45em;
           cursor: pointer;
-          font-size: .9em;
+          font-size: 1.15em;
+          line-height: 1;
           text-decoration: none;
           text-transform: uppercase;
         }
@@ -1216,7 +1221,7 @@ cat << _EOF_
       </script>
     </head>
     <body>
-      <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x263C;&#xFE0E;</a>
+      <a href="#" class="theme-toggle" aria-label="Toggle dark mode">&#x25D0;&#xFE0E;</a>
       <!-- No breadcrumb on a post. Its own segment would be the slug, which
            usually restates the title sitting directly beneath it -- and making
            that read well would mean choosing titles that differ from their
diff --git a/test/regressions.sh b/test/regressions.sh
index fc0eb81..0c76397 100755
--- a/test/regressions.sh
+++ b/test/regressions.sh
@@ -2079,8 +2079,12 @@ assert_file_contains "$dm/.dist/index.html" 'class="theme-toggle"'
 assert_file_contains "$dm/.dist/index.html" 'aria-label="Toggle dark mode"'
 
 it "the toggle button uses an entity glyph, not raw Unicode"
-assert_file_not_contains "$dm/.dist/index.html" '☀'
-assert_file_contains "$dm/.dist/index.html" '&#x263C;&#xFE0E;'
+# U+25D0, the half-filled circle that conventionally means contrast. The
+# variation selector matters as much as the codepoint: without &#xFE0E; a
+# platform is free to render the mark as a colour emoji, which is not what a
+# control set in the page's own type should look like.
+assert_file_not_contains "$dm/.dist/index.html" '◐'
+assert_file_contains "$dm/.dist/index.html" '&#x25D0;&#xFE0E;'
 
 it "the theme script applies data-theme and uses localStorage"
 assert_file_contains "$dm/.dist/index.html" 'data-theme'