diff options
author | tdro <tdro@noreply.example.com> | 2024-09-12 00:00:00 +0000 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2024-09-12 00:00:00 +0000 |
commit | 274d06edab4b543b501fa9b977fc43d8dda6bdb0 (patch) | |
tree | e005584345372de440a04cc5a4438ec756c72df4 | |
parent | c6a493101c50d4aef277750bdb09db21e2e2f136 (diff) | |
download | canory-274d06edab4b543b501fa9b977fc43d8dda6bdb0.tar.gz canory-274d06edab4b543b501fa9b977fc43d8dda6bdb0.tar.bz2 canory-274d06edab4b543b501fa9b977fc43d8dda6bdb0.zip |
themes/default/layouts/_default: Unify tab bar styles
-rw-r--r-- | assets/css/default.css | 1 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.drafts.html | 23 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.feeds.html | 19 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.html | 19 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.marks.html | 23 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.media.html | 23 | ||||
-rw-r--r-- | themes/default/layouts/partials/tabbar.css.html | 14 |
7 files changed, 41 insertions, 81 deletions
diff --git a/assets/css/default.css b/assets/css/default.css index 40137f5..ba4e0da 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -1561,6 +1561,7 @@ tab-bar nav a { text-decoration: none; top: 1px; border-bottom: 2px solid transparent; + opacity: 0.85; } tab-bar nav a:not(:last-child) { diff --git a/themes/default/layouts/_default/section.drafts.html b/themes/default/layouts/_default/section.drafts.html index 6204bcf..90a9301 100644 --- a/themes/default/layouts/_default/section.drafts.html +++ b/themes/default/layouts/_default/section.drafts.html @@ -1,24 +1,13 @@ {{- define "styles" -}} -{{- $author := partial "function-authors-data.html" . -}} -{{- $author = $author.user -}} -<style> - {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} - - tab-bar a[href*="{{ $author | relURL }}/drafts"] { - color: #111; - color: var(--foreground); - font-weight: 700; - text-decoration-color: #014cc6; - text-decoration-color: var(--link); - text-decoration: underline; - border-bottom: 2px solid var(--background); - } -</style> + <style> + {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} + {{ partial "tabbar.css.html" (dict "Context" . "Hash" "#drafts") | safeCSS }} + </style> {{- end -}} {{- define "header" -}} - {{- $author := partial "function-authors-data.html" . -}} - {{- $authors := where .Site.RegularPages "Section" $author.user -}} + {{- $author := .Section -}} + {{- $authors := where .Site.RegularPages "Section" $author -}} {{- $drafts := where .Site.RegularPages "Draft" true -}} {{- $filteredPages := $authors | intersect $drafts -}} {{- $paginator := .Paginate $filteredPages -}} diff --git a/themes/default/layouts/_default/section.feeds.html b/themes/default/layouts/_default/section.feeds.html index 2f391d8..172ff06 100644 --- a/themes/default/layouts/_default/section.feeds.html +++ b/themes/default/layouts/_default/section.feeds.html @@ -1,19 +1,8 @@ {{- define "styles" -}} -{{- $author := partial "function-authors-data.html" . -}} -{{- $author = $author.user -}} -<style> - {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} - - tab-bar a[href*="{{ $author | relURL }}/feeds"] { - color: #111; - color: var(--foreground); - font-weight: 700; - text-decoration-color: #014cc6; - text-decoration-color: var(--link); - text-decoration: underline; - border-bottom: 2px solid var(--background); - } -</style> + <style> + {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} + {{ partial "tabbar.css.html" (dict "Context" . "Hash" "#feeds") | safeCSS }} + </style> {{- end -}} {{- define "header" -}} diff --git a/themes/default/layouts/_default/section.html b/themes/default/layouts/_default/section.html index 89c669e..b653a87 100644 --- a/themes/default/layouts/_default/section.html +++ b/themes/default/layouts/_default/section.html @@ -1,19 +1,8 @@ {{- define "styles" -}} -<style> - {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} - - tab-bar a[href="{{ .CurrentSection.Permalink }}"], - tab-bar a[href^="{{ .CurrentSection.Permalink }}#"], - tab-bar a[href="{{ strings.TrimRight "/" .CurrentSection.Permalink }}"] { - color: #111; - color: var(--foreground); - font-weight: 700; - text-decoration-color: #014cc6; - text-decoration-color: var(--link); - text-decoration: underline; - border-bottom: 2px solid var(--background); - } -</style> + <style> + {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} + {{ partial "tabbar.css.html" (dict "Context" . "Hash" "#posts") | safeCSS }} + </style> {{- end -}} {{- define "header" -}} diff --git a/themes/default/layouts/_default/section.marks.html b/themes/default/layouts/_default/section.marks.html index bc35c50..b964a72 100644 --- a/themes/default/layouts/_default/section.marks.html +++ b/themes/default/layouts/_default/section.marks.html @@ -1,24 +1,13 @@ {{- define "styles" -}} -{{- $author := partial "function-authors-data.html" . -}} -{{- $author = $author.user -}} -<style> - {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} - - tab-bar a[href*="{{ $author | relURL }}/marks"] { - color: #111; - color: var(--foreground); - font-weight: 700; - text-decoration-color: #014cc6; - text-decoration-color: var(--link); - text-decoration: underline; - border-bottom: 2px solid var(--background); - } -</style> + <style> + {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} + {{ partial "tabbar.css.html" (dict "Context" . "Hash" "#marks") | safeCSS }} + </style> {{- end -}} {{- define "header" -}} - {{- $author := partial "function-authors-data.html" . -}} - {{- $authors := where .Site.RegularPages "Section" $author.user -}} + {{- $author := .Section -}} + {{- $authors := where .Site.RegularPages "Section" $author -}} {{- $items := where .Site.RegularPages ".Params.marked" true -}} {{- $filteredPages := $authors | intersect $items -}} {{- $paginator := .Paginate $filteredPages -}} diff --git a/themes/default/layouts/_default/section.media.html b/themes/default/layouts/_default/section.media.html index 4fc82fb..02b50b3 100644 --- a/themes/default/layouts/_default/section.media.html +++ b/themes/default/layouts/_default/section.media.html @@ -1,19 +1,8 @@ {{- define "styles" -}} -{{- $author := partial "function-authors-data.html" . -}} -{{- $author = $author.user -}} -<style> - {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} - - tab-bar a[href*="{{ $author | relURL }}/media"] { - color: #111; - color: var(--foreground); - font-weight: 700; - text-decoration-color: #014cc6; - text-decoration-color: var(--link); - text-decoration: underline; - border-bottom: 2px solid var(--background); - } -</style> + <style> + {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }} + {{ partial "tabbar.css.html" (dict "Context" . "Hash" "#media") | safeCSS }} + </style> {{- end -}} {{- define "header" -}} @@ -33,9 +22,9 @@ {{- end -}} {{- define "middle" -}} - {{- $author := partial "function-authors-data.html" . -}} + {{- $author := .Section -}} {{- $notFeeds := where .Site.RegularPages "Params.feed" "eq" nil -}} - {{- $authors := where .Site.RegularPages "Section" $author.user -}} + {{- $authors := where .Site.RegularPages "Section" $author -}} {{- $filteredPages := $authors | intersect $notFeeds -}} {{- $count := 0 -}} diff --git a/themes/default/layouts/partials/tabbar.css.html b/themes/default/layouts/partials/tabbar.css.html new file mode 100644 index 0000000..44a10a4 --- /dev/null +++ b/themes/default/layouts/partials/tabbar.css.html @@ -0,0 +1,14 @@ +{{- $hash := or .Hash "" -}} +{{- $pageContext := .Context -}} + +tab-bar a[href$="{{- $pageContext.RelPermalink -}}"], +tab-bar a[href$="{{- print $pageContext.RelPermalink $hash -}}"] { + opacity: 1; + color: #111; + color: var(--foreground); + font-weight: 700; + text-decoration-color: #014cc6; + text-decoration-color: var(--link); + text-decoration: underline; + border-bottom: 2px solid var(--background); +} |