From 508b669d222f6c0c454dc3fa278ccbccb417d69a Mon Sep 17 00:00:00 2001 From: Claas Date: Mon, 27 Jun 2022 17:28:43 +0200 Subject: [PATCH] Add tailwind CSS play CDN --- src/Time.Server/Index.fs | 69 +++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/src/Time.Server/Index.fs b/src/Time.Server/Index.fs index 9130fea..1eb0b71 100644 --- a/src/Time.Server/Index.fs +++ b/src/Time.Server/Index.fs @@ -5,16 +5,61 @@ open Bolero.Html open Bolero.Server.Html open Time -let page = doctypeHtml { - head { - meta { attr.charset "UTF-8" } - meta { attr.name "viewport"; attr.content "width=device-width, initial-scale=1.0" } - title { "Time" } - ``base`` { attr.href "/" } - link { attr.rel "stylesheet"; attr.href "css/index.css" } - } - body { - div { attr.id "app"; rootComp } - boleroScript +let page = + doctypeHtml { + head { + meta { attr.charset "UTF-8" } + + meta { + attr.name "viewport" + attr.content "width=device-width, initial-scale=1.0" + } + + title { "Time" } + ``base`` { attr.href "/" } + // Automatic dark mode + meta { + attr.name "color-scheme" + attr.content "dark light" + } + + meta { + attr.name "theme-color" + attr.content "#d800e9" + } + + meta { + attr.name "accent-color" + attr.content "#d800e9" + } + // For dark/light mode specifically + meta { + attr.name "theme-color" + attr.content "#d800e9" + } + + meta { + attr.name "accent-color" + attr.content "#872e4e" + attr.media "(prefers-color-scheme: dark)" + } +#if DEBUG + // Tailwind CSS play CDN only in development + script { attr.src "https://cdn.tailwindcss.com" } + style { attr.``type`` "text/tailwindcss" } +#endif + link { + attr.rel "stylesheet" + attr.href "css/index.css" + } + } + + body { + div { + attr.id "app" + rootComp + } + + boleroScript + } } -} -- knotmirror 0.0.1