piroor / treestyletab

Tree Style Tab, Show tabs like a tree.
http://piro.sakura.ne.jp/xul/treestyletab/
Other
3.46k stars 277 forks source link

Fade out tab label on overflow instead of ellipsis #1374

Closed Keith94 closed 6 years ago

Keith94 commented 6 years ago

Adding faded tab labels would look more consistent with the rest of Firefox UI. See https://bugzilla.mozilla.org/show_bug.cgi?id=658467

piroor commented 6 years ago

Firefox seems does it with very complicated technique, and it seems impossible to be done by simple CSS rules by 1 or 2 lines. I need PR to implement this.

Keith94 commented 6 years ago

@piroor Maybe this implementation (CSS) would work also for TST? https://github.com/eoger/tabcenter-redux/commit/c17a99dc67193ddd2b3564ba46cb8e7eafe651da

piroor commented 6 years ago

Hmm, Tab Center Redux's way seems different from Firefox's one.

Firefox:

Tab Center Redux:

piroor commented 6 years ago

Anyway both ways require more effort. To be honest I think both they are not attractive for me - the cost-performance seems not high. Until more easier way like text-overflow: fade-out is introduced, I won't implement this by myself. (Instead I'm still waiting PRs ;) )

Keith94 commented 6 years ago

Thanks for the info! Hopefully there will be an easier way at some point.

hyiltiz commented 6 years ago

text-overflow: fade-out should really be implemented within CSS. Two years since the proposal, and no browser really bothers to implement it.

https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow

Keith94 commented 6 years ago

@piroor I found some simple code that achieves the fade out effect quite nicely. Can you try it?

.tab .label {
  mask-image: linear-gradient(to left, transparent 0, black 2em);
}

image

piroor commented 6 years ago

@Keith94 Wow, this works on the released version of Firefox also!

piroor commented 6 years ago

I've added the rule as a built-in style of TST itself.

Keith94 commented 6 years ago

Looks good to me. :)