WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2024 Poal.co

1.4K

(post is archived)

[–] 1 pt (edited )

If you happen to use a custom CSS browser extension (like Stylus) for changing the appearance of individual sites, you can make it so clicking anywhere on a comment will change its background color and the background color of any parent comments to highlight them. This effect can be made to persist for a long length of time, a short length of time, or only while holding the mouse button down (but scrolling while holding the mouse button down will cause you to highlight a lot of text).

Adding this css code for this site will cause backgrounds of comments and their parents to change to poal blue for 999 seconds on a click or until the page is refreshed. You can change it to a much shorter time if you want only a few seconds or minutes of highlight.

___

.comment:active
{
background-color: #4163ac !important;
transition: background-color 0s !important;
}

.comment
{
transition: background-color 0s 999s !important;
}

___

It will look like this:
___

https://files.catbox.moe/syvvym.gif

___

If you change the 999s to 1s then the effect will persist after clicking on a comment for one second. Removing the 999s part (or changing it to 0s also) will cause it to only be highlighted while the mouse button is clicked down on a comment and letting off the button will revert it to normal.

___

Changing ".comment:active" on the first line to being ".comment:hover" will cause a comment and all of that comment's parent comments to highlight for that 999s time duration. So coupling the 999s being set to 0s and "active" being changed to "hover", you can make it so while you scroll and hover over comments, they will become highlighted, then moving off the comments will revert them. This is how I am going to set mine to function so a comment and its parent comments will highlight while hovered over. (I also changed the color to be slightly transparent so that each tier of comment will stack from darker to lighter)

https://files.catbox.moe/b64jgx.jpg ___

.comment:hover
{
background-color: #4163ac59 !important;
transition: background-color 0s !important;
}

.comment
{
transition: background-color 0s 0s !important;
}

___

To make it like you suggested so it will revert back to the default background color by re-clicking a comment or by clicking somewhere else, that would likely need to be done via javascript or through CSS and html if one has access to the page html.

( more info here if anyone is interested: https://tympanus.net/codrops/2012/12/17/css-click-events/ )

As a user and using CSS only, I can only see being able to make a one-way change instead of it working as a toggle as being possible as of now.

Just sharing this if it might be of interest to you or to others.