engine/view/styles/utils
@ckeditor/ckeditor5-engine/src/view/styles/utils
Filtering
Functions
-
getBoxSidesStyleShorthandValue( __namedParameters ) → string
module:engine/view/styles/utils~getBoxSidesStyleShorthandValue
Returns a shorthand notation of a CSS property value.
getBoxSidesStyleShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } ); // will return '1px 1px 2px'
Parameters
__namedParameters : BoxStyleSides
Returns
string
-
getBoxSidesStyleValueReducer( styleShorthand ) → ( value: StyleValue ) => Array<StylePropertyDescriptor>
module:engine/view/styles/utils~getBoxSidesStyleValueReducer
Default reducer for CSS properties that concerns edges of a box shorthand notations:
stylesProcessor.setReducer( 'padding', getBoxSidesStyleValueReducer( 'padding' ) );
Parameters
styleShorthand : string
Returns
( value: StyleValue ) => Array<StylePropertyDescriptor>
-
getBoxSidesStyleValues( value ) → BoxStyleSides
module:engine/view/styles/utils~getBoxSidesStyleValues
Parses box sides as individual values.
Parameters
value : string
-
Defaults to
''
Returns
-
getPositionStyleShorthandNormalizer( shorthand ) → ( value: string ) => object
module:engine/view/styles/utils~getPositionStyleShorthandNormalizer
Creates a normalizer for a shorthand 1-to-4 value.
stylesProcessor.setNormalizer( 'margin', getPositionStyleShorthandNormalizer( 'margin' ) );
Parameters
shorthand : string
Returns
( value: string ) => object
-
getShorthandStylesValues( string ) → Array<string>
module:engine/view/styles/utils~getShorthandStylesValues
Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
getShorthandStylesValues( 'red blue RGB(0, 0, 0)'); // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
Parameters
string : string
Returns
Array<string>
-
isAttachmentStyleValue( string ) → boolean
module:engine/view/styles/utils~isAttachmentStyleValue
Checks if string contains background attachment CSS value.
Parameters
string : string
Returns
boolean
-
isColorStyleValue( string ) → boolean
module:engine/view/styles/utils~isColorStyleValue
Checks if string contains color CSS value.
isColorStyleValue( '#f00' ); // true isColorStyleValue( '#AA00BB33' ); // true isColorStyleValue( 'rgb(0, 0, 250)' ); // true isColorStyleValue( 'hsla(240, 100%, 50%, .7)' ); // true isColorStyleValue( 'deepskyblue' ); // true
Note: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
Parameters
string : string
Returns
boolean
-
isLengthStyleValue( string ) → boolean
module:engine/view/styles/utils~isLengthStyleValue
-
isLineStyleValue( string ) → boolean
module:engine/view/styles/utils~isLineStyleValue
-
isPercentageStyleValue( string ) → boolean
module:engine/view/styles/utils~isPercentageStyleValue
-
isPositionStyleValue( string ) → boolean
module:engine/view/styles/utils~isPositionStyleValue
-
isRepeatStyleValue( string ) → boolean
module:engine/view/styles/utils~isRepeatStyleValue
-
isURLStyleValue( string ) → boolean
module:engine/view/styles/utils~isURLStyleValue
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.