Skip to content

Commit 6172116

Browse files
committed
feat(style): collapse comment by clicking indent line
1 parent e00ffbf commit 6172116

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/subreddit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use crate::{config, utils};
44
// CRATES
55
use crate::utils::{
6-
catch_random, error, filter_posts, format_num, format_url, info, nsfw_landing, param, redirect, rewrite_urls, setting, template, val, Post, Preferences, Subreddit,
6+
catch_random, error, filter_posts, format_num, format_url, info, nsfw_landing, param, redirect, rewrite_urls, setting, setting_or_default, template, val, Post, Preferences, Subreddit,
77
};
88
use crate::{client::json, server::RequestExt, server::ResponseExt};
99
use askama::Template;

static/style.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,19 @@ a.search_subreddit:hover {
14501450
flex-grow: 1;
14511451
flex-shrink: 1;
14521452
min-width: 0;
1453+
position: relative;
1454+
}
1455+
1456+
.comment_right[open] > .comment_data > .comment_collapse {
1457+
position: absolute; /* relative to .comment_right */
1458+
width: 20px;
1459+
left: -35px;
1460+
top: 45px;
1461+
height: calc(100% - 45px);
1462+
}
1463+
1464+
.comment:has(> .comment_right[open] > .comment_data > .comment_collapse:hover) > .comment_left * {
1465+
background: var(--highlighted);
14531466
}
14541467

14551468
.comment:has([id]) .comment_data > * {
@@ -2063,6 +2076,14 @@ th {
20632076
margin-top: -5px;
20642077
}
20652078

2079+
.comment_right[open] > .comment_data > .comment_collapse {
2080+
/* relative to .comment_right */
2081+
width: 15px;
2082+
left: -29px;
2083+
top: 35px;
2084+
height: calc(100% - 35px);
2085+
}
2086+
20662087
.line {
20672088
margin-left: 5px;
20682089
}

templates/comment.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
</span>
3535
{% endfor %}
3636
{% endif %}
37+
<div class="comment_collapse"></div>
3738
</summary>
3839
{% if is_filtered %}
3940
<div class="comment_body_filtered {% if highlighted %}highlighted{% endif %}">(Filtered content)</div>

0 commit comments

Comments
 (0)