From a33c7b20c99caa73f28ce71f0a7f0fedb65add88 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 23 Sep 2022 00:27:33 +0400 Subject: [PATCH] A little refactor of CSS. :is() selector got into action wherever is suitable. --- homepage/static/assets/css/articles.css | 8 +-- homepage/static/assets/css/guestbook.js.css | 73 --------------------- homepage/static/assets/css/index.css | 3 +- homepage/static/assets/css/main.css | 10 +-- 4 files changed, 6 insertions(+), 88 deletions(-) delete mode 100644 homepage/static/assets/css/guestbook.js.css diff --git a/homepage/static/assets/css/articles.css b/homepage/static/assets/css/articles.css index 48e68b7..11c5ca2 100644 --- a/homepage/static/assets/css/articles.css +++ b/homepage/static/assets/css/articles.css @@ -16,13 +16,9 @@ h5 { text-indent: 1.5rem; margin: 1rem 0 1rem 0; } -h3 a, -h4 a, -h5 a { color: var(--text-color); } +:is(h3, h4, h5) a { color: var(--text-color); } -h3 a:hover, -h4 a:hover, -h5 a:hover { color: var(--primary-color); } +:is(h3, h4, h5) a:hover { color: var(--primary-color); } code, pre { diff --git a/homepage/static/assets/css/guestbook.js.css b/homepage/static/assets/css/guestbook.js.css deleted file mode 100644 index 7ac7e57..0000000 --- a/homepage/static/assets/css/guestbook.js.css +++ /dev/null @@ -1,73 +0,0 @@ -::placeholder { - color: #a5a5a5; - font-family: 'Roboto Condensed', Roboto, sans-serif; - font-size: 1.1rem; } - -#new-post { - display: grid; - gap: .5rem; - grid-template-areas: - "n e w" - "m m m" - "c c b"; - grid-template-columns: 1fr 1fr 1fr; -} - -#new-post input[name="name"] { grid-area: n; } - -#new-post input[name="email"] { grid-area: e; } - -#new-post input[name="website"] { grid-area: w; } - -#new-post .chkgrp { grid-area: c; } - -#new-post textarea { - grid-area: m; - height: 5.5rem; - max-width: 100%; - min-width: 100%; } - -#new-post input[type="submit"] { - background-color: var(--primary-color); - border: none; - color: #f5f5f5; - grid-area: b; - height: 2rem; } - -#new-post span .checkbox:not(:last-child) { margin-right: 2rem; } - -#new-post input[type="text"], -#new-post textarea, -#posts-pagination input#current-page, -#posts-pagination button { - background-color: var(--background-color); - border: none; - border-bottom: 1px solid var(--primary-color); - color: var(--text-color); - font-family: 'Roboto Condensed', Roboto, sans-serif; - font-size: 1.1rem; } - -#posts article:not(:last-child) { margin-bottom: 1rem; } - -#posts article header { display: inline; font-size: .8rem; } - -#posts article main, -#posts article div.feedback main, -#posts article div.feedback { margin-left: .5rem; } - -#posts-pagination input#current-page { width: 1.7rem; } - -#posts-pagination button { border: none; } - -@media screen and (max-width: 641px) { - #new-post { - gap: 1.5rem; - grid-template-areas: - "n" - "e" - "w" - "m" - "c" - "b"; - grid-template-columns: 1fr; } -} \ No newline at end of file diff --git a/homepage/static/assets/css/index.css b/homepage/static/assets/css/index.css index 90a2d6b..48db1d5 100644 --- a/homepage/static/assets/css/index.css +++ b/homepage/static/assets/css/index.css @@ -9,8 +9,7 @@ nav a:last-child { margin-left: .6rem; } nav, #services { text-align: center; width: 100%; } -#services a, -#services span { margin: .3rem; } +#services :is(a, span) { margin: .3rem; } #services span a { margin: 0; } diff --git a/homepage/static/assets/css/main.css b/homepage/static/assets/css/main.css index daf4664..0c0ede7 100644 --- a/homepage/static/assets/css/main.css +++ b/homepage/static/assets/css/main.css @@ -54,7 +54,7 @@ p:not(:last-child) { margin-bottom: .1rem; } p.center { text-align: center; - text-indent: 0px; } + text-indent: 0; } h1 { font-size: 1.8rem; @@ -83,8 +83,7 @@ h3.service-down::after { font-size: .7rem; margin-right: -.9rem; vertical-align: super; - padding-left: .2rem; -} + padding-left: .2rem; } small, figure figcaption { font-size: .8rem; } @@ -180,10 +179,7 @@ section { width: 100%; word-wrap: break-word; } -#contacts a, -#contacts span, -#donation a, -#donation span { margin: .3rem; } +:is(#contacts, #donation) :is(a, span) { margin: .3rem; } #contacts span a { margin: 0; }