From 99d729755488fd7556d5faae29d3ec545a7849d5 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 16 Dec 2019 23:36:20 -0600 Subject: [PATCH] html: Modernizing the styling for html help. --- basis/help/html/html.factor | 19 +++++++++++++------ basis/help/html/stylesheet.css | 27 ++++++++++++++++++++++----- extra/webapps/help/search.xml | 2 +- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index d494ad71c7..59f813a216 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -67,7 +67,12 @@ M: pathname url-of prepend ] [ drop f ] if ; -: help-stylesheet ( stylesheet -- xml ) +: prepend-help-viewport ( xml -- xml' ) + [XML + + XML] prepend ; + +: help-stylesheet ( assoc -- xml' ) "vocab:help/html/stylesheet.css" ascii file-contents swap "\n" glue [XML XML] ; @@ -75,14 +80,16 @@ M: pathname url-of "conventions" >link topic>filename [XML XML] ; @@ -120,7 +127,7 @@ M: pathname url-of [ article-title " - Factor Documentation" append ] [ [ print-topic ] with-html-writer css-styles-to-classes - [ help-stylesheet ] [ help-navbar prepend ] bi* + [ help-stylesheet prepend-help-viewport ] [ help-navbar prepend ] bi* ] bi simple-page ; : generate-help-file ( topic -- ) diff --git a/basis/help/html/stylesheet.css b/basis/help/html/stylesheet.css index 0103d04334..cde6bd8ca5 100644 --- a/basis/help/html/stylesheet.css +++ b/basis/help/html/stylesheet.css @@ -1,12 +1,29 @@ +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { +} +@media (max-width: 35em) { + :root { + //font-size: 5.125em; + } +} +@media (min-width: 50em) { +} a:link { text-decoration: none; color: #104e8b; } a:visited { text-decoration: none; color: #104e8b; } a:active { text-decoration: none; color: #104e8b; } a:hover { text-decoration: underline; color: #104e8b; } .navbar { - background-color: #f3f2ea; - padding: 5px; - border: 1px solid #ccc; - font: 9pt sans-serif; - margin-bottom: 10px; + display: flex; + align-items: baseline; + background-color: #f3f2ea; + padding: 5px; + border: 1px solid #ccc; + font: 9pt sans-serif; + margin-bottom: 10px; } + +.navbar div:last-child { + margin-left: auto; + padding: 4px; +} + diff --git a/extra/webapps/help/search.xml b/extra/webapps/help/search.xml index 35a9d1ef1e..57439f92ad 100644 --- a/extra/webapps/help/search.xml +++ b/extra/webapps/help/search.xml @@ -32,7 +32,7 @@ - +

Articles