Problem/Motivation

Thanks for the great module, but I noticed an issue which is that sometimes color names are longer than one word, eg:
color palette label length issue on drupal

So it's best to make the styling so that the full name is always visible and get rid of the hardcoded max-width

Steps to reproduce

Use long name colors

Proposed resolution

I'll provide a MR

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

doxigo created an issue. See original summary.

doxigo’s picture

Status: Active » Needs review
StatusFileSize
new73.98 KB

Provided the MR, adjusted the color palette block size to 64px, removed the max-width of 52px for label, made it so that if necessary the label can break down into multi-line, eg:
Fixed color palette label sizing on Drupal colorpalette module

abhaysaraf’s picture

Hi doxigo,
Thank you for sharing the concern & the patch too.

With long names, if you consider long name say 2, 3 or 4 lines (in the above image it is of 2 lines long), and there are 100s of colors available in the palette. In this case, you will see an uneven gap between the color-rows.

While designing, I thought to hide it intentionally because the idea behind is to see the actual-color than reading the color-name and opting it.
I also thought to add the full name in the title(when you mouse-hover) along with hexcode, but again that could be a lot of details to the other user.

Let me know your thoughts or if a better solution could be given to this concern. Thanks!

doxigo’s picture

StatusFileSize
new55.13 KB

Hey Abhay, thanks for your thoughts and considerations, I see your point

I suggest to consider the common use cases, which can be 1 line or two the max, and more than 3 line within our 64px block can be trimmed, like image below:
color palette label length issue on drupal

I went on and updated the MR using line-clamp to limit the name to two lines, if more than that it just adds the elipsis

let me know if that makes more sense