Module

engine/view/styles/utils

@ckeditor/ckeditor5-engine/src/view/styles/utils

module

Filtering

Functions

  • getBoxSidesShorthandValue( __namedParameters ) → string

    Returns a shorthand notation of a CSS property value.

    getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );
    // will return '1px 1px 2px'
    

    Parameters

    __namedParameters : BoxSides

    Returns

    string
  • getBoxSidesValueReducer( styleShorthand ) → ( StyleValue ) => Array<PropertyDescriptor>

    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

    Parses box sides as individual values.

    Parameters

    value : string

    Defaults to ''

    Returns

    BoxSides
  • getPositionShorthandNormalizer( shorthand ) → ( string ) => object

    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>

    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