font/utils
@ckeditor/ckeditor5-font/src/utils
Filtering
Constants
-
FONT_BACKGROUND_COLOR : 'fontBackgroundColor'
module:font/utils~FONT_BACKGROUND_COLOR
The name of the font background color plugin.
-
FONT_COLOR : 'fontColor'
module:font/utils~FONT_COLOR
The name of the font color plugin.
-
FONT_FAMILY : 'fontFamily'
module:font/utils~FONT_FAMILY
The name of the font family plugin.
-
FONT_SIZE : 'fontSize'
module:font/utils~FONT_SIZE
The name of the font size plugin.
Type Definitions
-
ColorSelectorDropdownView
module:font/utils~ColorSelectorDropdownView
-
FontConverterDefinition
module:font/utils~FontConverterDefinition
Functions
-
addColorSelectorToDropdown( options = { options.colorPickerLabel, options.colorPickerViewConfig, options.colors, options.columns, [options.documentColorsCount], [options.documentColorsLabel], options.dropdownView, options.removeButtonLabel } ) → ColorSelectorView
module:font/utils~addColorSelectorToDropdown
A helper that adds
ColorSelectorView
to the color dropdown with proper initial values.Parameters
options : object
Configuration options
Propertiesoptions.colorPickerLabel : string
The label for the color picker button.
options.colorPickerViewConfig : false | ColorPickerViewConfig
Configuration of the color picker view.
options.colors : Array<ColorDefinition>
An array with definitions representing colors to be displayed in the color selector.
options.columns : number
The number of columns in the color grid.
[ options.documentColorsCount ] : number
The number of document colors inside the dropdown.
[ options.documentColorsLabel ] : string
The label for the section with document colors.
options.dropdownView : ColorSelectorDropdownView
The dropdown view to which a
ColorSelectorView
will be added.options.removeButtonLabel : string
The label for the button responsible for removing the color.
Returns
ColorSelectorView
The new color selector view.
-
buildDefinition( modelAttributeKey, options ) → FontConverterDefinition
module:font/utils~buildDefinition
Builds a proper converter definition out of input data.
Parameters
modelAttributeKey : string
options : Array<FontFamilyOption> | Array<FontSizeOption>
Returns
-
renderDowncastElement( styleAttr ) → ( modelAttributeValue: string, __namedParameters: DowncastConversionApi ) => AttributeElement
module:font/utils~renderDowncastElement
A font color and font background color helper responsible for downcasting a color attribute to a
<span>
element.Note: The
styleAttr
parameter should be either'color'
or'background-color'
.Parameters
styleAttr : string
Returns
( modelAttributeValue: string, __namedParameters: DowncastConversionApi ) => AttributeElement
-
renderUpcastAttribute( styleAttr ) → ( viewElement: Element ) => string
module:font/utils~renderUpcastAttribute
A font color and font background color helper responsible for upcasting data to the model.
Note: The
styleAttr
parameter should be either'color'
or'background-color'
.Parameters
styleAttr : string
Returns
( viewElement: Element ) => string
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.