From 2833849c77f1fdf5d95d88b928cc50b348d032dc Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 22 Feb 2023 23:02:19 +0900 Subject: Inline CSS --- xhtml.cr | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'xhtml.cr') diff --git a/xhtml.cr b/xhtml.cr index 4fd58eb..4f7eca4 100644 --- a/xhtml.cr +++ b/xhtml.cr @@ -18,6 +18,22 @@ require "xml" +CSS = " + html { + margin: auto; + max-width: 72ch; + } + body { margin-bottom: 2rem } + h1, h2, h3, h4, h5, h6 { margin: 1ex 0 } + form { + display: grid; + grid-template-columns: max-content 1fr 0; + } + form label { margin-right: 1ch } + form input { margin-bottom: 1ex } + .error { color: red } + " + def criteria(xml) xml.element "h2" do xml.text "criteria" end xml.element "p" do @@ -37,8 +53,8 @@ def criteria(xml) end end xml.element "p" do - xml.text "Note that the two sites needn't be the same," - xml.text " but represent the same entity (person or organization)." + xml.text "Note that the two sites needn't be the same, as long as" + xml.text " they represent the same entity, e.g. person or organization." xml.text " The clear net site is for serving visitors" xml.text " without OpenNIC access or preferring secure connections." end @@ -96,9 +112,7 @@ def page(errors = {} of String => String, xml.element "meta", name: "viewport", content: "width=device-width,initial-scale=1.0" xml.element "link", rel: "icon", href: "data:," - xml.element "link", rel: "stylesheet", - # FIXME: get base URL from configuration - href: "http://127.0.0.1:42069/style.css" + xml.element "style" do xml.text CSS end xml.element "title" do xml.text "le cercle libre" end end xml.element "body" do -- cgit 1.4.1