ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.6k stars 3.71k forks source link

Whitespace inconsistency between default color values and values returned by color picker in HSL format #17386

Open Acrophost opened 1 week ago

Acrophost commented 1 week ago

πŸ“ Provide detailed reproduction steps (if any)

  1. Open a demo which has changable color with color picker and default color values, e.g. https://ckeditor.com/docs/ckeditor5/latest/features/tables/tables-styling.html#demo
  2. Change a color with default values. Here for example, we change cell background color to red.
  3. Change color with color picker.

βœ”οΈ Expected result

The format of a color of default color values (ones unchanged by users) should be consistent with the one obtained from color picker.

❌ Actual result

Color picker adds whitespaces inside the HSL brackets, while those are not there in case of default value colors (unless set otherwise), e.g. we get a hsl(0, 75%, 60%) value while picking red from default colors (in editor shown as red, but upon inspecting inline styles we have the hsl format) and hsl( 207, 83%, 32% ) from color picker. Image

πŸ“ƒ Other details

This works like this for any place with default color/color picker, including font color, font background color, table cell background color, table cell border color, table border color, table background color.


If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

mmotyczynska commented 1 week ago

It may just be a matter of removing some extra spaces here: https://github.com/ckeditor/ckeditor5/blob/686f41636329f204b34a483ee091d2bdddc8750f/packages/ckeditor5-ui/src/colorpicker/utils.ts#L126-L137