crabmail

Static HTML email archive viewer in Rust
git clone git://git.alexwennerberg.com/crabmail
Log | Files | Refs | README | LICENSE

commit c8988ce985a575890af334ce4870186124beb9d8
parent 1ed00a31b126fdc9b04c00e48b360b7fdba6e292
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Fri, 31 Dec 2021 23:58:20 -0800

refactor CSS

Diffstat:
Msrc/main.rs | 13++++++-------
Msrc/style.css | 76++++++++++++++++------------------------------------------------------------
2 files changed, 22 insertions(+), 67 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -197,7 +197,7 @@ impl<'a> ThreadList<'a> { hr; @ for thread in &self.threads { div(class="message-sum") { - a(class="threadlink", href=format!("threads/{}.html", &thread.hash)) { + a(class="bigger", href=format!("threads/{}.html", &thread.hash)) { : &thread.messages[0].subject } : format!(" ({})", thread.messages.len() -1) ; @@ -206,7 +206,7 @@ impl<'a> ThreadList<'a> { : short_name(&thread.messages[0].from) } - span(class="timeago") { + span(class="light") { : format!(" {created} | updated {last}", created=timestring(thread.messages[0].date), last=timestring(thread.last_reply())) } br; @@ -317,11 +317,11 @@ impl<'a> MailThread<'a> { } } br; - a(href=format!("mailto:{}", &message.from.addr), class="addr bold") { + a(href=format!("mailto:{}", &message.from.addr), class="bold") { : &message.from.to_string(); } br; - span(class="timeago") { + span(class="light") { : &message.date_string } a(title="permalink", href=format!("#{}", &message.id)) { @@ -505,11 +505,10 @@ fn write_index(lists: Vec<String>) -> Result<()> { } hr; @for list in &lists { - p{ - a(href=list, class="threadlink") { + a(href=list, class="bigger") { :list; } - } + br; } }; let file = File::create(&Config::global().out_dir.join("index.html"))?; diff --git a/src/style.css b/src/style.css @@ -1,19 +1,17 @@ :root { - --light-text: dimgrey; - --main-link: #00F; - --secondary-link: #00F; + --link: #00F; --background: white; --main-text: black; + --light-text: dimgrey; } -@media (prefers-color-scheme: dark) { +/* @media (prefers-color-scheme: dark) { */ :root { --main-text: white; --light-text: #CCC; - --main-link: #55F; - --secondary-link: #55F; - --background: #111; -} + --link: #21e6c1; + --background: #1b262c; } +/* } */ body { padding: 2ch; @@ -41,41 +39,34 @@ table { border-spacing: 0.5em 0.1em; } margin-top: 6px; margin-bottom: 12px; } + .right { text-align: right; } -.addr { - color: var(--secondary-link); -} - .bold { font-weight: bold; } -.threadlink { - font-size: 1.2rem; - color: var(--main-link); +a { + text-decoration: none; + color: var(--link); } -.timeago { - color: var(--light-text); +.bigger { + font-size: 1.2rem; } -.reply-text { +.light { color: var(--light-text); } + .email-body { white-space:pre-line; font-family:monospace; font-size: 1rem; } - -.filesize { - text-align: right; -} - .footer { text-align: center; font-style: italic; @@ -93,53 +84,18 @@ h1, h2, h3 { margin: 0; } -h3 { - margin-right: 2em; -} - -pre { - line-height: 1.2; - font-size: 1rem; - overflow: auto; - margin: 0; - padding: 0; -} - -td { - white-space: nowrap; - margin: 0; - border-style:hidden; - padding: 0; -} - -table td { - padding: 0 0.1em; -} - -a { - text-decoration: none; - color: var(--secondary-link); -} - a:visited { } + a:hover{ + text-decoration: none; text-decoration: underline; } -table.core { - width: 100%; - border-collapse: collapse; -} - @media only screen and (max-width: 600px) { body { font-size: 16px; } - - .junk { - display: none; - } }