Vigilans / accountcolors

Fork of the Account Colors add-on for Thunderbird
Mozilla Public License 2.0
13 stars 0 forks source link

[Feature] Color gradients #4

Closed MIOsystems closed 7 months ago

MIOsystems commented 7 months ago

For an even more subtle and fine look it is effective to gradient the selected color to the default background color from left to right (or settable)

Vigilans commented 7 months ago

I personally prefer the label style so implemented it for myself. If you prefer the gradient style, you can take a look at this commit: https://github.com/Vigilans/accountcolors/commit/502360b92fc754badc1714162c5c681fd8435e25: Support coloring row background as label in thread pane.

It necessarily does all the things to introduce the label style feature:

The core CSS rendering logic is:

https://github.com/Vigilans/accountcolors/blob/fe162d8ba2bf11b4ef4985d34c82c164a11c5fef/chrome/skin/accountcolors-about3pane.css#L207-L209

It is based on given --ac-bkgd-color and render it as background-image with linear-gradient.

Seems your feature can exactly be interpreted as linear-gradient, so you can just implement the feature yourself and open a PR for it.

MIOsystems commented 7 months ago

I'm a little bit familiar with CSS. But simply have no idea how to implement it. I suggest just two boolean settings [Enable Gradient] and [Left or Right]. Then the gradient is composed with the account color and default background in a linear way. Alternatively there is a text field as setting and fill in the hole CSS code for that. Then we have the most customizability.

Vigilans commented 7 months ago

You can use Ctrl + Shift + I to open inspect tool, Ctrl+Shift+C and click on a row to select <tr id=threadTree-row...> element.

On the right style pane, click accountcolors-about3pane.css:... to jump to the CSS source code. Then, in about line 203, modify background-color to background-image and linear-gradient with your preferred behavior.

By doing this you can test your preferred looking on the fly, and share your final CSS rule here.

MIOsystems commented 7 months ago

background-image: linear-gradient(90deg, rgb(255, 233, 233) 0%, rgb(255, 255, 255) 100%);

For the best impression i also add it to the #threadPane > tree-view Now it looks more like i would recommend.

Gradient

Vigilans commented 7 months ago

Implemented in #8:

Download in https://github.com/Vigilans/accountcolors/releases/download/tb-115-v2/accountcolors.zip

MIOsystems commented 7 months ago

Your awesome. Works like a charm.