From e67b2c24af61fcdd3f60c74a121077c99a62f7ec Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 20 Feb 2020 14:57:29 +0000 Subject: [PATCH] use svg icons for taxonomies,date and time icons --- assets/scss/_content.scss | 26 +++++++++++++++-------- assets/scss/_content_dark.scss | 8 ++++++- layouts/partials/list.html | 4 ++-- layouts/partials/svg/calendar.svg | 4 ++++ layouts/partials/svg/clock.svg | 4 ++++ layouts/partials/svg/folder.svg | 3 +++ layouts/partials/svg/tag.svg | 3 +++ layouts/partials/taxonomy/categories.html | 5 ++++- layouts/partials/taxonomy/tags.html | 5 ++++- layouts/posts/single.html | 4 ++-- 10 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 layouts/partials/svg/calendar.svg create mode 100644 layouts/partials/svg/clock.svg create mode 100644 layouts/partials/svg/folder.svg create mode 100644 layouts/partials/svg/tag.svg diff --git a/assets/scss/_content.scss b/assets/scss/_content.scss index 1b748b2..b212b18 100644 --- a/assets/scss/_content.scss +++ b/assets/scss/_content.scss @@ -89,6 +89,8 @@ } div.content .meta-tag { + display: flex; + align-items: center; padding: 0 12px; margin: 3px; border-radius: 1px; @@ -96,8 +98,11 @@ div.content .meta-tag { color: lighten($fg-color, 15%); - i { + .icon { + display: flex; font-size: 0.9em; + line-height: 1; + padding-right: 1ch; } &--link { @@ -112,19 +117,23 @@ div.content .meta-tag { .icon { color: $link-color; } - } - i { - font-size: 1em; - &.material-icons-outlined { - vertical-align: text-bottom; + .svg-icon { + color: $fg-color; } } - .icon { + .svg-icon { color: $fg-color; } } + + .svg-icon { + > svg { + height: 1em; + width: 1em; + } + } } .post-meta .meta-tag:not(.meta-tag--link) { @@ -201,9 +210,8 @@ div.content .meta-tag { text-align: center; .meta-tag { + display: inline-flex; font-size: 0.7em; - padding-top: 6px; - padding-bottom: 6px; margin-bottom: 1.6rem; i { diff --git a/assets/scss/_content_dark.scss b/assets/scss/_content_dark.scss index 75f429a..31b342b 100644 --- a/assets/scss/_content_dark.scss +++ b/assets/scss/_content_dark.scss @@ -35,12 +35,18 @@ } .meta-tag { - color: darken($fg-color-dark, 35%); + $tag-color: darken($fg-color-dark, 35%); + + color: $tag-color; background-color: lighten($bg-color-dark, 5%); &--link { color: $link-color-dark; + .icon { + color: $tag-color; + } + &:hover { opacity: 1; color: lighten($link-color-dark, 15%); diff --git a/layouts/partials/list.html b/layouts/partials/list.html index 5f3eed2..c2e17b0 100644 --- a/layouts/partials/list.html +++ b/layouts/partials/list.html @@ -6,9 +6,9 @@
{{- if eq .Data.Singular "category" -}} - folder + {{ partial "svg/folder.svg" }} {{- else if eq .Data.Singular "tag" -}} - local_offer + {{ partial "svg/tag.svg" }} {{- end -}} {{- .Data.Term -}} diff --git a/layouts/partials/svg/calendar.svg b/layouts/partials/svg/calendar.svg new file mode 100644 index 0000000..1220b67 --- /dev/null +++ b/layouts/partials/svg/calendar.svg @@ -0,0 +1,4 @@ + + + + diff --git a/layouts/partials/svg/clock.svg b/layouts/partials/svg/clock.svg new file mode 100644 index 0000000..e3bcbc2 --- /dev/null +++ b/layouts/partials/svg/clock.svg @@ -0,0 +1,4 @@ + + + + diff --git a/layouts/partials/svg/folder.svg b/layouts/partials/svg/folder.svg new file mode 100644 index 0000000..ea3aaa2 --- /dev/null +++ b/layouts/partials/svg/folder.svg @@ -0,0 +1,3 @@ + + + diff --git a/layouts/partials/svg/tag.svg b/layouts/partials/svg/tag.svg new file mode 100644 index 0000000..c5e2e4b --- /dev/null +++ b/layouts/partials/svg/tag.svg @@ -0,0 +1,3 @@ + + + diff --git a/layouts/partials/taxonomy/categories.html b/layouts/partials/taxonomy/categories.html index a8f66d9..511c6ed 100644 --- a/layouts/partials/taxonomy/categories.html +++ b/layouts/partials/taxonomy/categories.html @@ -1,3 +1,6 @@ {{- range $index, $el := . -}} - folder{{ . }} + + {{ partial "svg/folder.svg" }} + {{ . }} + {{- end -}} diff --git a/layouts/partials/taxonomy/tags.html b/layouts/partials/taxonomy/tags.html index 8294291..3519108 100644 --- a/layouts/partials/taxonomy/tags.html +++ b/layouts/partials/taxonomy/tags.html @@ -1,3 +1,6 @@ {{- range $index, $el := . -}} - local_offer{{ . }} + + {{ partial "svg/tag.svg" }} + {{ . }} + {{- end -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 7248ba2..aa5cbe8 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -10,13 +10,13 @@
- calendar_today + {{ partial "svg/calendar.svg" }}
- watch_later + {{ partial "svg/clock.svg" }} {{ i18n "reading_time" .ReadingTime }}