gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Archived lable highglight via linear gradient

Open 6543 opened this issue 1 year ago • 8 comments

image image


Sponsored by Kithara Software GmbH

6543 avatar Apr 09 '24 21:04 6543

This reduce/increases contrast depending on color. I think it could be made to always increase by adding dark stripes when text is white and light stripes when text is black, but you would likely need a classname to know which variant to apply.

silverwind avatar Apr 09 '24 21:04 silverwind

will the general concept work? (Yes/NO)

6543 avatar Apr 09 '24 21:04 6543

I'm undecided. Think at least the stripes need to be wider to make an impact on these small lables, maybe 2-3px per stripe.

silverwind avatar Apr 09 '24 21:04 silverwind

Maybe like this:

/* label with black text */
repeating-linear-gradient(-45deg, transparent, transparent 6px, #fff5 6px, #fff5 12px)

/* label with white text */
repeating-linear-gradient(-45deg, transparent, transparent 6px, #0005 6px, #0005 12px)
image

silverwind avatar Apr 09 '24 22:04 silverwind

So yes, I think it could work. You would need to use the CSS multiple backgrounds feature, and it could either be added as inline style like current color is or with a CSS class like light-text and dark-text and if we go that route, I would also move the current inline style for color to CSS.

background: <color>, <gradient>;

silverwind avatar Apr 10 '24 15:04 silverwind

For testing one could do a very dirty kind of CSS selector:

.archived-label[style^="color: #fff"] {
  background-image: repeating-linear-gradient(-45deg, transparent, transparent 6px, #0005 6px, #0005 12px);
}

.archived-label[style^="color: #000"] {
  background-image: repeating-linear-gradient(-45deg, transparent, transparent 6px, #fff5 6px, #fff5 12px);
}

silverwind avatar Apr 10 '24 16:04 silverwind

@delvh this is not ready yet 😆.

silverwind avatar Apr 10 '24 20:04 silverwind

@silverwind updated screnshoot

6543 avatar Oct 07 '24 09:10 6543

An archived label should not have a highlight UI. It should be grey or disabled. Maybe a dashed line border is better.

lunny avatar Oct 23 '24 17:10 lunny

I personally am for highlighting ... as:

  1. Normaly you dont interact with them
  2. They should be easy to spot or at least differentiate
  3. we already grey out atm ... but you can not see them easily as archived ... amd completly grey is just another color of lables so thats no good indicator

6543 avatar Oct 23 '24 21:10 6543

I personally am for highlighting ... as:

1. Normaly you dont interact with them

2. They should be easy to spot or at least differentiate

3. we already grey out atm ... but you can not see them easily as archived ... amd completly grey is just another color of lables so thats no good indicator

Since it's archived, it should not be highlighted. Isn't it?

lunny avatar Oct 24 '24 05:10 lunny

in this logic we should "highlight" the normal labels ?

6543 avatar Nov 12 '24 21:11 6543

in this logic we should "highlight" the normal labels ?

We should not highlight any labels and archived labels should have a special gray color.

lunny avatar Nov 25 '24 21:11 lunny

We should not highlight any labels and archived labels should have a special gray color.

they do ... so it is as is :/

for those who want the patch, just use some custom css:

.archived-label {
  /* we disable upstream highlighting style */
  filter: none !important;
  opacity: 1 !important;
}

/* we applay proposed change of https://github.com/go-gitea/gitea/pull/30376 */
.archived-label[style^="color: #000"],
.archived-label.scope-parent .scope-left[style^="color: #000"],
.archived-label.scope-parent .scope-right[style^="color: #000"] {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(0, 0, 0, 0.2) 6px,
    rgba(0, 0, 0, 0.2) 12px
  );
}
.archived-label[style^="color: #fff"],
.archived-label.scope-parent .scope-left[style^="color: #fff"],
.archived-label.scope-parent .scope-right[style^="color: #fff"] {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(255, 255, 255, 0.3) 6px,
    rgba(255, 255, 255, 0.3) 12px
  );
}

6543 avatar Nov 25 '24 21:11 6543

scope-left[style^="color: #000"] is too tricky.

If you could use a standard class name, and determine it from label render (light or dark), then it could look good to me.

image

wxiaoguang avatar Nov 26 '24 01:11 wxiaoguang