Skip to content

Commit 15da9a3

Browse files
authored
DOC-2498: Added support for using raw CSS in the list of possible colours, using the color_map_raw property. (#3501)
* DOC-2498: Added support for using raw CSS in the list of possible colours, using the color_map_raw property. * DOC-2598: Add note to thank @andrewnicols for contributing to this feature.
1 parent 8cdcd0a commit 15da9a3

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

modules/ROOT/pages/7.5-release-notes.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,19 @@ In previous versions of {productname}, an issue was identified where screen read
190190

191191
{productname} {release-version} also includes the following addition<s>:
192192

193+
=== Added support for using raw CSS in the list of possible colours, using the `color_map_raw` property.
194+
// #TINY-11385
195+
196+
In previous versions of {productname}, the `color_map` property allowed users to define a list of colors for the color picker dropdown. However, this property only supported predefined color names or hex values, limiting the customization options for users who wanted to include custom colors using raw CSS.
197+
198+
{productname} {release-version} addresses this limitation by introducing the `color_map_raw` property. This new property allows users to define a list of colors using raw CSS values, providing greater flexibility and customization options for the color picker dropdown.
199+
200+
As a result, users can now include custom colors, or other CSS properties in the color map.
201+
202+
For more information on customizing the color picker, see xref:user-formatting-options.adoc#color_map_raw[`+color_map_raw+` option].
203+
204+
NOTE: {companyname} Technologies would like to thank link:https://github.com/andrewnicols[Andrew Nicols] for contributing to this feature.
205+
193206
=== Added new default `li` element styles to the content CSS to prevent child list elements from inheriting certain parent list item styles.
194207
// #TINY-11217
195208

modules/ROOT/partials/configuration/text_color.adoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,32 @@ tinymce.init({
145145
});
146146
----
147147

148+
[[color_map_raw]]
149+
=== `+color_map_raw+`
150+
151+
The `color_map_raw` option specifies a map of text colors that appear in the color picker grid. This configuration provides detailed control over the colors available for the `forecolor` and `backcolor` toolbar options. The following example shows how to set the color map using CSS variables, color functions, and hex codes.
152+
153+
*Type:* `+Array+`
154+
155+
==== Example: using `+color_map_raw+`
156+
157+
[source,js]
158+
----
159+
tinymce.init({
160+
selector: 'textarea', // Adjust this value according to your HTML
161+
toolbar: 'forecolor backcolor',
162+
color_map_raw: [
163+
'var(--black)', 'Black', // CSS variable-based colors
164+
'var(--red)', 'Red',
165+
'hsb(0, 100%, 100%)', 'White hsb', // Color functions like hsb() and hsl()
166+
'hsl(0, 100%, 50%)', 'Red hsl',
167+
'#ff00ff', 'Pink', // Hex code-based colors
168+
'#00ffff', 'Cyan',
169+
'var(--purple)', 'Purple', // User-friendly labels for easy identification such as 'Purple'.
170+
'#00FF7F', 'Spring Green'
171+
],
172+
});
173+
----
148174

149175
[[color_map_background]]
150176
=== `color_map_background`

0 commit comments

Comments
 (0)