diff options
author | boasting-squirrel <boasting.squirrel@gmail.com> | 2019-02-26 22:54:36 +0000 |
---|---|---|
committer | boasting-squirrel <boasting.squirrel@gmail.com> | 2019-02-26 22:54:36 +0000 |
commit | db87865631477fafc8b4e62f444514e853014856 (patch) | |
tree | 06a1c86c52b489edb087849f1b3376d740c12867 /src | |
parent | Stylized table header + added chevrons (diff) | |
download | miniserve-db87865631477fafc8b4e62f444514e853014856.tar.gz miniserve-db87865631477fafc8b4e62f444514e853014856.zip |
Added highlight for current sorting column
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/renderer.rs b/src/renderer.rs index 24942d8..846d18b 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -55,9 +55,11 @@ fn build_link( let mut link = format!("?sort={}&order=asc", name); let mut help = format!("Sort by {} in ascending order", name); let mut chevron = chevron_up(); + let mut class = ""; if let Some(method) = sort_method { if method.to_string() == name { + class = "active"; if let Some(order) = sort_order { if order.to_string() == "asc" { link = format!("?sort={}&order=desc", name); @@ -69,9 +71,10 @@ fn build_link( }; html! { - (chevron) - - a href=(link) title=(help) { (title) } + span class=(class) { + (chevron) + a href=(link) title=(help) { (title) } + } } } @@ -258,6 +261,12 @@ fn css() -> Markup { th a, th a:visited { color: #777c82; } + th span.active a { + color: #d24ca9; + } + th span.active svg { + fill: #d24ca9; + } @media (max-width: 600px) { h1 { font-size: 1.375em; |