]> gitweb.factorcode.org Git - factor.git/commitdiff
help.html: bit more style
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 28 Jun 2022 03:08:44 +0000 (20:08 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 28 Jun 2022 03:08:44 +0000 (20:08 -0700)
basis/help/html/html.factor
basis/help/html/stylesheet.css

index 9e550c5b4f7e605bd57a6cf8a3ad0fa2b2117a71..af9c790250b70d6445ef5e5b995a7d030fe693c1 100644 (file)
@@ -141,8 +141,14 @@ M: pathname url-of
     ] re-replace-with
 
     R/ font-family: monospace;/ [
-        " border: 1px solid #ccc; border-radius: 5px; white-space: pre-wrap; line-height: 125%; margin: 15px; width: calc(100% - 30px);" append
-    ] re-replace-with ;
+        " white-space: pre-wrap; line-height: 125%;" append
+    ] re-replace-with
+
+    "font-family: monospace;" over subseq? [
+        "background-color:" over subseq?
+    ] [ f ] if [
+        " border: 1px solid #ccc; border-radius: 5px; margin: 15px; width: calc(100% - 30px);" append
+    ] when ;
 
 : fix-help-header ( classes -- classes )
     dup [
@@ -161,7 +167,7 @@ M: pathname url-of
     ] [ drop ] if* ;
 
 : dark-mode-css ( classes -- classes' )
-    { "/* Dark mode */" "@media (prefers-color-scheme:dark) {" }
+    { "" "/* Dark mode */" "@media (prefers-color-scheme:dark) {" }
     swap [
         R/ {[^}]+}/ [
             "{" ?head drop "}" ?tail drop ";" split
@@ -189,7 +195,7 @@ M: pathname url-of
     ] map harvest append "}" suffix ;
 
 : mobile-css ( classes -- classes' )
-    { "/* Mobile */" "@media screen and (max-width: 600px) {" }
+    { "" "/* Mobile */" "@media screen and (max-width: 600px) {" }
     swap [
         R/ {[^}]+}/ [
             "{" ?head drop "}" ?tail drop ";" split
@@ -200,13 +206,13 @@ M: pathname url-of
             " " join "{ " " }" surround
         ] re-replace-with "    " prepend
         "{  }" over subseq? [ drop f ] when
-    ] map harvest append "}" suffix ;
+    ] map harvest append "}" suffix ;
 
 : css-classes ( classes -- stylesheet )
     [
         [ fix-css-style " { " "}" surround ] [ "." prepend ] bi* prepend
     ] { } assoc>map fix-help-header dup
-    [ dark-mode-css ] [ mobile-css ] bi 3append join-lines ;
+    [ dark-mode-css ] [ mobile-css ] bi 3append join-lines ;
 
 :: css-styles-to-classes ( body -- stylesheet body )
     H{ } clone :> classes
index 8b899060e0d29ad52d807e8c810d21642088a43c..d72a5c05aebd09e5fa12edd87989ba668bb96eb9 100644 (file)
@@ -1,4 +1,4 @@
-99html {
+html {
     box-sizing: border-box;
 }