From 0fe0e0a38b42810428712252b779632aa8fd483f Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Sat, 4 Nov 2023 19:53:00 +0400 Subject: [PATCH] Theme: basic styles + posts list --- themes/qogir/assets/css/main.css | 65 +++++++++++++++----- themes/qogir/layouts/_default/home.html | 3 +- themes/qogir/layouts/_default/list.html | 3 +- themes/qogir/layouts/_default/terms.html | 9 +++ themes/qogir/layouts/partials/post-item.html | 4 ++ 5 files changed, 66 insertions(+), 18 deletions(-) create mode 100644 themes/qogir/layouts/_default/terms.html create mode 100644 themes/qogir/layouts/partials/post-item.html diff --git a/themes/qogir/assets/css/main.css b/themes/qogir/assets/css/main.css index 166ade9..15107fb 100644 --- a/themes/qogir/assets/css/main.css +++ b/themes/qogir/assets/css/main.css @@ -1,22 +1,59 @@ body { - color: #222; - font-family: sans-serif; - line-height: 1.5; - margin: 1rem; - max-width: 768px; + padding: 0 0.25rem; + margin: auto; + max-width: 48rem; + color: #e6ebef; + background: #32343d; + font-family: 'Roboto', 'Ubuntu', sans-serif; } -header { - border-bottom: 1px solid #222; - margin-bottom: 1rem; -} - -footer { - border-top: 1px solid #222; - margin-top: 1rem; +h1, h2, h3, h4, h5, h6 { + margin: 0; } a { - color: #00e; + color: #a9caf1; text-decoration: none; } +a:hover { + color: #d5e5f8; +} + +.post-item { + padding: 3%; + border-radius: 0.25rem; + background: #282a33; +} +.post-item h2 a { + color: #e6ebef; +} +.post-item div { + /* Make the same value as in post-item's 3% padding. + * 100 / 94 = ratio .post-item width / this div width, + * 94 = 100% - (3% * 2), where + * 3% is the padding in .post-item, + * 3 * 2 = padding-left + padding-right = 3% + 3% + */ + margin-top: calc(3% * 100 / (100 - 3 * 2)); +} + +a.button { + padding: 0.25rem 0.5rem; + border-radius: 0.25rem; + + background: transparent; + color: #e6ebef; + border: 0.0625rem solid rgba(255, 255, 255, 0.2); + + transition: + background-color 0.075s linear, + border-color 0.1s linear; +} +a.button:hover { + background: rgba(255, 255, 255, 0.1); + border-color: rgba(255, 255, 255, 0.1); +} +a.button:active { + background: #5294e2; + border-color: #5294e2; +} diff --git a/themes/qogir/layouts/_default/home.html b/themes/qogir/layouts/_default/home.html index 0df6597..036baa6 100644 --- a/themes/qogir/layouts/_default/home.html +++ b/themes/qogir/layouts/_default/home.html @@ -1,7 +1,6 @@ {{ define "main" }} {{ .Content }} {{ range site.RegularPages }} -

{{ .LinkTitle }}

- {{ .Summary }} + {{ partial "post-item.html" . }} {{ end }} {{ end }} diff --git a/themes/qogir/layouts/_default/list.html b/themes/qogir/layouts/_default/list.html index 50fc92d..5db397a 100644 --- a/themes/qogir/layouts/_default/list.html +++ b/themes/qogir/layouts/_default/list.html @@ -2,7 +2,6 @@

{{ .Title }}

{{ .Content }} {{ range .Pages }} -

{{ .LinkTitle }}

- {{ .Summary }} + {{ partial "post-item.html" . }} {{ end }} {{ end }} diff --git a/themes/qogir/layouts/_default/terms.html b/themes/qogir/layouts/_default/terms.html new file mode 100644 index 0000000..96d0534 --- /dev/null +++ b/themes/qogir/layouts/_default/terms.html @@ -0,0 +1,9 @@ +{{ define "main" }} +

{{ .Title }}

+ {{ .Content }} + {{ range .Pages }} +
+ {{ .Title }} +
+ {{ end }} +{{ end }} diff --git a/themes/qogir/layouts/partials/post-item.html b/themes/qogir/layouts/partials/post-item.html new file mode 100644 index 0000000..9b829f4 --- /dev/null +++ b/themes/qogir/layouts/partials/post-item.html @@ -0,0 +1,4 @@ +
+

{{ .Title }}

+
{{ .Summary }}
+