engine/view/styles/utils
@ckeditor/ckeditor5-engine/src/view/styles/utils
module
Filtering
Functions
-
getBoxSidesShorthandValue( __namedParameters ) → string
module:engine/view/styles/utils~getBoxSidesShorthandValue
-
getBoxSidesValueReducer( styleShorthand ) → ( StyleValue ) => Array<PropertyDescriptor>
module:engine/view/styles/utils~getBoxSidesValueReducer
Default reducer for CSS properties that concerns edges of a box shorthand notations:
stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
Parameters
styleShorthand : string
Returns
( StyleValue ) => Array<PropertyDescriptor>
-
getBoxSidesValues( value ) → BoxSides
module:engine/view/styles/utils~getBoxSidesValues
Parses box sides as individual values.
Parameters
value : string
-
Defaults to
''
Returns
-
getPositionShorthandNormalizer( shorthand ) → ( string ) => object
module:engine/view/styles/utils~getPositionShorthandNormalizer
Creates a normalizer for a shorthand 1-to-4 value.
stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
Parameters
shorthand : string
Returns
( string ) => object
-
getShorthandValues( string ) → Array<string>
module:engine/view/styles/utils~getShorthandValues
Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
getShorthandValues( 'red blue RGB(0, 0, 0)'); // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
Parameters
string : string
Returns
Array<string>
-
isAttachment( string ) → boolean
module:engine/view/styles/utils~isAttachment
Checks if string contains background attachment CSS value.
Parameters
string : string
Returns
boolean
-
isColor( string ) → boolean
module:engine/view/styles/utils~isColor
Checks if string contains color CSS value.
isColor( '#f00' ); // true isColor( '#AA00BB33' ); // true isColor( 'rgb(0, 0, 250)' ); // true isColor( 'hsla(240, 100%, 50%, .7)' ); // true isColor( '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
-
isLength( string ) → boolean
module:engine/view/styles/utils~isLength
-
isLineStyle( string ) → boolean
module:engine/view/styles/utils~isLineStyle
-
isPercentage( string ) → boolean
module:engine/view/styles/utils~isPercentage
-
isPosition( string ) → boolean
module:engine/view/styles/utils~isPosition
-
isRepeat( string ) → boolean
module:engine/view/styles/utils~isRepeat
-
isURL( string ) → boolean
module:engine/view/styles/utils~isURL
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.