Overhaul the look of tags; integrate a category and a cute little triangle
This commit is contained in:
parent
bb4b2cd4e9
commit
d5f9f2a765
3 changed files with 65 additions and 21 deletions
|
@ -1,18 +1,20 @@
|
||||||
:root {
|
:root {
|
||||||
--post-item-highlight-color: #efefef;
|
--post-item-highlight-color: #efefef;
|
||||||
|
|
||||||
--tag-text-color: #666;
|
--tag-foreground-color: rgb(var(--super-dk-gray));
|
||||||
--tag-background-color: #eee;
|
--tag-background-color: rgb(var(--super-lt-gray));
|
||||||
--tag-hover-background-color: #bbb;
|
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
|
||||||
|
--tag-hover-background-color: rgb(var(--sub-lt-gray));
|
||||||
}
|
}
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
:root {
|
:root {
|
||||||
--post-item-highlight-color: #121212;
|
--post-item-highlight-color: #121212;
|
||||||
|
|
||||||
--tag-text-color: #888;
|
--tag-foreground-color: rgb(var(--sub-lt-gray));
|
||||||
--tag-background-color: rgb(40, 40, 40);
|
--tag-background-color: rgb(var(--dk-gray));
|
||||||
--tag-hover-background-color: rgb(73, 73, 73);
|
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
|
||||||
--tag-hover-foreground-color: #666;
|
--tag-hover-background-color: rgb(var(--super-dk-gray));
|
||||||
|
--tag-hover-foreground-color: rgb(var(--mid-gray));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,36 +34,54 @@
|
||||||
margin-block-start: 3.5rem;
|
margin-block-start: 3.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog footer .tags {
|
.blog .tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-inline-start: 0;
|
padding-inline-start: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog footer .tags li {
|
.blog .tags li {
|
||||||
background-color: var(--tag-background-color);
|
background-color: var(--tag-background-color);
|
||||||
|
color: var(--tag-foreground-color);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 75%;
|
font-size: 75%;
|
||||||
letter-spacing: 2px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog footer .tags li:hover {
|
.blog .tags li:hover {
|
||||||
background-color: var(--tag-hover-background-color);
|
background-color: var(--tag-hover-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog footer .tags li a {
|
.blog .tags li a {
|
||||||
color: var(--tag-text-color);
|
color: inherit;
|
||||||
display: block;
|
display: block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.6rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog footer .tags li a:hover {
|
.blog .tags li a:hover {
|
||||||
color: var(--tag-hover-foreground-color);
|
color: var(--tag-hover-foreground-color);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog footer .tags li + li {
|
.blog .tags li + li { margin-inline-start: 1rem; }
|
||||||
margin-inline-start: 1rem;
|
.blog .tags li.chevron + li { margin-inline-start: 0 }
|
||||||
|
|
||||||
|
.blog .tags .chevron {
|
||||||
|
align-items: center;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
color: var(--tag-spacer-foreground-color);
|
||||||
|
background-color: inherit;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-inline-start: 0;
|
||||||
|
padding-inline-start: 1px;
|
||||||
|
width: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blog .tags .chevron:hover {
|
||||||
|
color: var(--tag-background-color);
|
||||||
|
background-color: inherit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,25 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
{{- if .Params.tags -}}
|
{{- if or .Params.categories .Params.tags -}}
|
||||||
<ul class="tags">
|
<ul class="tags">
|
||||||
{{- range (.GetTerms "tags") -}}
|
{{- if .Params.categories -}}
|
||||||
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
{{- $categories := .GetTerms "categories" -}}
|
||||||
{{- end -}}
|
{{- if gt (len $categories) 1 -}}
|
||||||
|
{{- errorf "More than one category for %q" .Path -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with index (.GetTerms "categories") 0 -}}
|
||||||
|
<li class="category"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if and .Params.categories .Params.tags -}}
|
||||||
|
<li class="chevron noselect">⏵</li>
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .Params.tags -}}
|
||||||
|
{{- range .GetTerms "tags" -}}
|
||||||
|
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
</ul>
|
</ul>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
--black: 0, 0, 0;
|
--black: 0, 0, 0;
|
||||||
--sub-dk-gray: 16, 16, 16;
|
--sub-dk-gray: 16, 16, 16;
|
||||||
--dk-gray: 32, 32, 32;
|
--dk-gray: 32, 32, 32;
|
||||||
|
--super-dk-gray: 80, 80, 80;
|
||||||
--mid-gray: 128, 128, 128;
|
--mid-gray: 128, 128, 128;
|
||||||
|
--sub-lt-gray: 175, 175, 175;
|
||||||
--lt-gray: 223, 223, 223;
|
--lt-gray: 223, 223, 223;
|
||||||
--super-lt-gray: 240, 240, 240;
|
--super-lt-gray: 240, 240, 240;
|
||||||
--white: 255, 255, 255;
|
--white: 255, 255, 255;
|
||||||
|
@ -521,7 +523,15 @@ p:last-child { margin-block-end: 0; }
|
||||||
|
|
||||||
.centered { text-align: center; }
|
.centered { text-align: center; }
|
||||||
.float-right { float: right; }
|
.float-right { float: right; }
|
||||||
|
|
||||||
.nobreak { white-space: nowrap; }
|
.nobreak { white-space: nowrap; }
|
||||||
|
.noselect {
|
||||||
|
cursor: default;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-use-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
.platter {
|
.platter {
|
||||||
background: var(--background-color);
|
background: var(--background-color);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue