From 536494b1e9bd5eda363837faacbed0ad46bfc5ae Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Tue, 23 Dec 2025 13:47:44 -0330 Subject: theme: css and nav --- themes/aoidh/assets/css/aoidh.css | 87 ++++++++++++++++++++++++++++ themes/aoidh/assets/css/main.css | 22 ------- themes/aoidh/layouts/_partials/head/css.html | 10 +--- themes/aoidh/layouts/_partials/menu.html | 25 +++----- themes/aoidh/layouts/baseof.html | 1 + 5 files changed, 97 insertions(+), 48 deletions(-) create mode 100644 themes/aoidh/assets/css/aoidh.css delete mode 100644 themes/aoidh/assets/css/main.css (limited to 'themes/aoidh') diff --git a/themes/aoidh/assets/css/aoidh.css b/themes/aoidh/assets/css/aoidh.css new file mode 100644 index 0000000..5307ee0 --- /dev/null +++ b/themes/aoidh/assets/css/aoidh.css @@ -0,0 +1,87 @@ +:root { + --paper-color: #ffffea; + --dark-yellow: #99994c; + --light-blue: #eaffff; + --dark-blue: #8888cc; + --light-gray: #eee; + --dark-gray: #888; +} + +html { + background: var(--light-gray); +} + +body { + display: block; + float: none; + margin-left: auto; + margin-right: auto; + line-height: 1.5rem; + max-width: 60rem; + margin-top: 2rem; + margin-bottom: 2rem; + padding: .5rem 1rem .25rem; + border: 1px solid var(--dark-gray); + box-shadow: 2px 2px var(--dark-yellow); +} + +body { + font-family: serif; + text-rendering: optimizeLegibility; + color: #000; + background: #fff; +} + +header { + margin-bottom: 2rem; +} + +nav { + display: block; +} + +nav ul { + display: flex; + list-style-type: none; +} + +nav a { + color: #000; + background: #fff; + padding: .2rem 1.5rem .2rem 1.5rem; + margin: .1rem 0 .1rem 1rem; + border: .1rem solid var(--dark-blue); + box-shadow: .1rem .1rem var(--dark-blue); +} + +nav li:first-child a { + margin-left: 0; +} + +nav a:hover, nav a:focus { + color: #000; + background: var(--light-blue); +} + +nav a:active { + color: #000; + background: #fff; + box-shadow: 0 0; +} + +ul { + padding: 0; +} + +p { + text-align: justify; + max-width: 40rem; +} + +a { + text-decoration: none; +} + +p a { + text-decoration: underline; +} diff --git a/themes/aoidh/assets/css/main.css b/themes/aoidh/assets/css/main.css deleted file mode 100644 index 166ade9..0000000 --- a/themes/aoidh/assets/css/main.css +++ /dev/null @@ -1,22 +0,0 @@ -body { - color: #222; - font-family: sans-serif; - line-height: 1.5; - margin: 1rem; - max-width: 768px; -} - -header { - border-bottom: 1px solid #222; - margin-bottom: 1rem; -} - -footer { - border-top: 1px solid #222; - margin-top: 1rem; -} - -a { - color: #00e; - text-decoration: none; -} diff --git a/themes/aoidh/layouts/_partials/head/css.html b/themes/aoidh/layouts/_partials/head/css.html index d76d23a..dec8013 100644 --- a/themes/aoidh/layouts/_partials/head/css.html +++ b/themes/aoidh/layouts/_partials/head/css.html @@ -1,9 +1,3 @@ -{{- with resources.Get "css/main.css" }} - {{- if hugo.IsDevelopment }} - - {{- else }} - {{- with . | minify | fingerprint }} - - {{- end }} - {{- end }} +{{- with resources.Get "css/aoidh.css" }} + {{- end }} diff --git a/themes/aoidh/layouts/_partials/menu.html b/themes/aoidh/layouts/_partials/menu.html index 14245b5..485fe0b 100644 --- a/themes/aoidh/layouts/_partials/menu.html +++ b/themes/aoidh/layouts/_partials/menu.html @@ -21,26 +21,15 @@ Renders a menu for the given menu ID. {{- define "_partials/inline/menu/walk.html" }} {{- $page := .page }} {{- range .menuEntries }} - {{- $attrs := dict "href" .URL }} - {{- if $page.IsMenuCurrent .Menu . }} - {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} - {{- else if $page.HasMenuCurrent .Menu .}} - {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} - {{- end }} - {{- $name := .Name }} - {{- with .Identifier }} - {{- with T . }} - {{- $name = . }} - {{- end }} - {{- end }}
  • {{ $name }} + {{ if $page.IsMenuCurrent .Menu . }} + class="nav-active" + {{ else if $page.HasMenuCurrent .Menu . }} + class="nav-ancestor" + {{ end }} + {{ printf "href=%q" .URL | safeHTMLAttr }} + >{{ .Name }} {{- with .Children }}