Change up site CSS and inline messages' CSS
This commit is contained in:
@@ -280,7 +280,11 @@ fn view_part(part: &Part) -> Node<Msg> {
|
||||
"text/plain" => view_text_plain(&part.content),
|
||||
"text/html" => {
|
||||
if let Some(Content::String(html)) = &part.content {
|
||||
let inlined = css_inline::inline(html).expect("failed to inline CSS");
|
||||
let inliner = css_inline::CSSInliner::options()
|
||||
.load_remote_stylesheets(false)
|
||||
.remove_style_tags(true)
|
||||
.build();
|
||||
let inlined = inliner.inline(html).expect("failed to inline CSS");
|
||||
|
||||
return div![C!["view-part-text-html"], div!["TEST"], raw![&inlined]];
|
||||
} else {
|
||||
@@ -351,16 +355,17 @@ fn set_title(title: &str) {
|
||||
seed::document().set_title(&format!("lb: {}", title));
|
||||
}
|
||||
|
||||
fn tags_chiclet(tags: &[String]) -> impl Iterator<Item = Node<Msg>> + '_ {
|
||||
tags.iter().map(|tag| {
|
||||
fn tags_chiclet(tags: &[String], is_mobile: bool) -> impl Iterator<Item = Node<Msg>> + '_ {
|
||||
tags.iter().map(move |tag| {
|
||||
let mut hasher = DefaultHasher::new();
|
||||
tag.hash(&mut hasher);
|
||||
let hex = format!("#{:06x}", hasher.finish() % (1 << 24));
|
||||
let style = style! {St::BackgroundColor=>hex};
|
||||
let classes = C!["tag", IF!(is_mobile => "is-small")];
|
||||
match tag.as_str() {
|
||||
"attachment" => span![C!["tag"], style, "📎"],
|
||||
"replied" => span![C!["tag"], style, i![C!["fa-solid", "fa-reply"]]],
|
||||
_ => span![C!["tag"], style, tag],
|
||||
"attachment" => span![classes, style, "📎"],
|
||||
"replied" => span![classes, style, i![C!["fa-solid", "fa-reply"]]],
|
||||
_ => span![classes, style, tag],
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -410,14 +415,16 @@ fn view_mobile_search_results(query: &str, search_results: &SearchSummary) -> No
|
||||
ev(Ev::Click, move |_| Msg::ShowPrettyRequest(tid)),
|
||||
]
|
||||
*/
|
||||
let tid = r.thread.clone();
|
||||
div![
|
||||
p![C!["subject"], &r.subject],
|
||||
div![C!["subject"], &r.subject],
|
||||
div![
|
||||
span![C!["from"], pretty_authors(&r.authors)],
|
||||
span![C!["tags"], tags_chiclet(&r.tags)],
|
||||
span![C!["tags"], tags_chiclet(&r.tags, true)],
|
||||
],
|
||||
span![C!["date"], &r.date_relative],
|
||||
hr![],
|
||||
ev(Ev::Click, move |_| Msg::ShowPrettyRequest(tid)),
|
||||
]
|
||||
});
|
||||
div![h1!["Search results"], rows]
|
||||
@@ -437,7 +444,7 @@ fn view_search_results(query: &str, search_results: &SearchSummary) -> Node<Msg>
|
||||
pretty_authors(&r.authors),
|
||||
IF!(r.total>1 => small![" ", r.total.to_string()]),
|
||||
],
|
||||
td![C!["subject"], tags_chiclet(&r.tags), " ", &r.subject],
|
||||
td![C!["subject"], tags_chiclet(&r.tags, false), " ", &r.subject],
|
||||
td![C!["date"], &r.date_relative],
|
||||
ev(Ev::Click, move |_| Msg::ShowPrettyRequest(tid)),
|
||||
]
|
||||
@@ -592,7 +599,7 @@ fn view_mobile(model: &Model) -> Node<Msg> {
|
||||
};
|
||||
div![
|
||||
view_header(&model.query, &model.refreshing_state),
|
||||
section![C!["section"], div![C!["container"], content],]
|
||||
section![C!["section"], div![C!["content"], content],]
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user