1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +00:00

Simplify styling

Comply with the upcoming article on best practices for textual websites.
This commit is contained in:
rohan kumar 2020-11-23 15:47:27 -08:00
parent 1a9b5f4dd4
commit 712ca3737c
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
6 changed files with 106 additions and 250 deletions

View file

@ -2,6 +2,8 @@
{{ trim (readFile (replace $.File.Path ".md" ".gmi")) "\n" | safeHTML }}
---
“{{$.Title | safeHTML}}” was published on {{.Date.Format "January 2, 2006"}}.
=> / Back to the home page{{ with .OutputFormats.Get "html" }}

View file

@ -2,47 +2,32 @@
@media (prefers-color-scheme: dark) {
{{ end -}}
body {
color: #ebebeb;
background: #121212;
:root {
--dim-text: #a7a7a7;
--shaded-bg: #222;
}
html{
color: white;
background: black;
}
header#banner a {
color: #e0e0e0;
text-decoration: none;
}
header#banner nav ul li a {
color: #cccccc;
color: white;
}
main#content a, footer a {
color: #00b1ed;
}
main#content p {
color: #f5f5f5;
}
main#content hr {
background: #5c5c5c;
border-color: #5c5c5c;
}
main#content #toc h4 {
color: #d4d4d4;
}
main#content ul#posts small {
color: #a7a7a7;
}
main#content ul#posts li a:hover {
color: #21c7ff;
}
main#content header#post-header time {
color: #a7a7a7;
}
{{- if not (eq .Site.Params.dark "on") -}}
}
{{- end -}}

View file

@ -1,28 +1,24 @@
*, *:before, *:after {
box-sizing: border-box;
:root {
--dim-text: #454545;
--shaded-bg: #e3e3e3;
}
html {
font-size: 62.5%;
line-height: 1.5rem;
font-family: sans-serif;
}
body {
font-size: 16px;
font-size: 1.6rem;
font-family: sans-serif;
color: #313a3d;
width: 100%;
max-width: 1000px;
margin: 0 auto;
padding: 0 16px;
line-height: 1.6;
padding: 0 5rem;
}
header#banner {
margin: 25px 0;
margin: 2rem 0;
}
header#banner a {
color: #313a3d;
color: black;
text-decoration: none;
}
@ -32,39 +28,33 @@ header#banner a:hover {
header#banner h2 {
display: inline;
font-size: 21px;
font-size: 2.1rem;
margin: 0 8px 0 0;
font-size: 1.5rem;
}
header#banner nav {
display: inline-block;
padding: 0 1rem;
}
header#banner nav ul {
list-style-type: none;
font-size: 1.05em;
font-size: 1.25rem;
text-transform: lowercase;
margin: 0;
padding: 0;
padding: 0
}
header#banner nav ul li {
display: inline;
margin: 0 3px;
margin: 0 0.5rem;
}
header#banner nav ul li a {
color: #454545;
color: var(--dim-text);
}
main#content a, footer a {
color: #007dfa;
text-decoration: none;
}
main#content a:hover {
text-decoration: underline;
}
main#content h1,
@ -73,53 +63,23 @@ main#content h3,
main#content h4,
main#content h5,
main#content h6 {
margin-bottom: 0;
line-height: 1.15;
}
main#content h3 {
font-size: 19px;
font-size: 1.9rem;
}
main#content h1 + p,
main#content h2 + p,
main#content h3 + p,
main#content h4 + p,
main#content h5 + p,
main#content h6 + p {
margin-top: 5px;
}
main#content p {
color: #394548;
margin: 16px 0;
}
main#content hr {
height: 1px;
border: 0;
background: #d8d8d8;
display: block;
margin: 1.5rem 0 1rem;
}
/* index.html styles */
main#content ul#posts {
list-style-type: none;
font-size: 16px;
font-size: 1.6rem;
margin-top: 0;
padding: 0;
}
main#content ul#posts li {
margin: 5px 0;
line-height: 2rem;
padding: 0;
}
main#content ul#posts small {
font-size: 0.8em;
color: #767676;
margin-left: 10px;
color: var(--dim-text);
}
main#content ul#posts li a {
@ -127,53 +87,28 @@ main#content ul#posts li a {
}
main#content ul#posts li a:hover {
color: #369aff;
}
main#content ul#posts li a:hover small {
color: inherit;
text-decoration: underline;
}
/* single.html styles */
main#content header#post-header h1 {
display: block;
font-size: 23px;
font-size: 2.3rem;
line-height: 1.15;
main#content h1 {
font-size: 1.5rem;
line-height: 2.5rem;
}
main#content header#post-header time {
display: block;
font-size: 0.85em;
color: #767676;
main#content h2 {
font-size: 1.25rem;
}
main#content h3 {
font-size: 1.125rem;
}
main#content #toc {
border: 1px solid #b1b1b1;
border-radius: 1px;
line-height: 26px;
margin: 16px 0;
padding: 9px 14px;
}
main#content #toc h4 {
font-size: 1.06em;
color: #3d3d3d;
margin: 0;
margin: 1rem 0;
padding: 0.5rem 1rem;
}
main#content #toc nav#TableOfContents {
margin-top: 4px;
}
main#content #toc nav#TableOfContents > ul, main#content #toc nav#TableOfContents > ol {
margin-left: -40px;
}
main#content #toc ul, main#content #toc ol {
font-size: 0.98em;
margin: 0;
padding: 0 0 0 40px;
margin-top: 0.25rem;
}
main#content #toc ul {
@ -188,11 +123,6 @@ main#content #toc ol li {
display: block;
}
main#content #toc ol li:before {
content: counters(item, ".") ". ";
counter-increment: item;
}
main#content img {
max-width: 100%;
margin: 0 auto;
@ -211,10 +141,9 @@ main#content figure img {
main#content figure figcaption {
font-size: 0.92em;
font-style: italic;
line-height: 22px;
line-height: 1.5rem;
text-align: center;
margin-top: 6px;
padding: 0 10px;
padding: 0 1rem;
}
main#content figure figcaption h4 {
@ -226,40 +155,26 @@ main#content figure figcaption h4 {
main#content figure figcaption p {
display: inline;
margin: 0;
padding-left: 8px;
}
main#content code,
main#content pre {
font-family: monospace;
padding-left: 0.5rem;
}
main#content code {
font-size: 14px;
padding: 0 5px;
font-size: 16px;
background-color: var(--shaded-bg);
}
main#content pre {
display: block;
overflow-x: auto;
font-size: 14px;
white-space: pre;
margin: 20px 0;
padding: 1.5rem 1.5rem;
line-height: 1.4;
overflow-y: visible;
overflow-x: scroll;
background-color: var(--shaded-bg);
padding: 0.5rem;
}
main#content pre code {
padding: 0;
}
main#content section.footnotes {
font-size: 0.9em;
main#content code {
padding: 0.1rem 0.25rem;
}
footer#footer {
font-size: 14px;
font-size: 1.4rem;
color: #949494;
margin: 40px 0;
color: var(--dim-text);
margin: 2rem 0;
}

View file

@ -0,0 +1,6 @@
@media (max-width: 770px) {
body {
max-width: 600px;
padding: 0 1rem;
}
}

View file

@ -1,52 +0,0 @@
@media (min-width: 770px) {
body {
width: 600px;
line-height: 1.5;
}
main#content hr {
width: 108%;
margin-left: -3.8%;
}
/* index.html styles */
header#banner h2 {
font-size: 25px;
font-size: 2.5rem;
}
main#content h3 {
font-size: 20px;
font-size: 2rem;
}
main#content ul#posts {
font-size: 18px;
font-size: 1.8rem;
}
/* single.html styles */
main#content header#post-header h1 {
font-size: 26px;
font-size: 2.6rem;
}
main#content img {
max-width: 108%;
margin-left: -3.8%;
}
main#content figure {
margin-left: -3.8%;
}
main#content figure img {
max-width: 108%;
}
main#content pre {
width: 108%;
margin-left: -3.8%;
padding: 1.5rem 2.2rem;
}
}

View file

@ -11,7 +11,7 @@
{{ $resources = $resources | append (resources.Get "/css/main.css") -}}
{{ $resources = $resources | append (resources.Get "/css/min770px.css") -}}
{{ $resources = $resources | append (resources.Get "/css/max770px.css") -}}
{{ $dark := .Site.Params.dark | default "auto" -}}
{{ if not (eq $dark "off") -}}