engine/view/styles/utils
@ckeditor/ckeditor5-engine/src/view/styles/utils
Filtering
Functions
-
getBoxSidesShorthandValue( styleShorthand ) → function
-
getBoxSidesValueReducer( styleShorthand ) → function
Default reducer for CSS properties that concerns edges of a box shorthand notations:
stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
Parameters
styleShorthand : String
Returns
function
-
getPositionShorthandNormalizer( shorthand ) → function
Creates a normalizer for a shorthand 1-to-4 value.
stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
Parameters
shorthand : String
Returns
function
-
getShorthandValues( string ) → Array.<String>
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
Checks if string contains background attachment CSS value.
Parameters
string : String
Returns
Boolean
-
isColor( string ) → Boolean
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
Checks if string contains length CSS value.
Parameters
string : String
Returns
Boolean
-
isLineStyle( string ) → Boolean
Checks if string contains line style CSS value.
Parameters
string : String
Returns
Boolean
-
isPercentage( string ) → Boolean
Checks if string contains percentage CSS value.
Parameters
string : String
Returns
Boolean
-
isPosition( string ) → Boolean
Checks if string contains background position CSS value.
Parameters
string : String
Returns
Boolean
-
isRepeat( string ) → Boolean
Checks if string contains background repeat CSS value.
Parameters
string : String
Returns
Boolean
-
isURL( string ) → Boolean
Checks if string contains URL CSS value.
Parameters
string : String
Returns
Boolean