engine/view/styles/utils
module
Functions
-
getBoxSidesStyleShorthandValue( __namedParameters ) → stringmodule:engine/view/styles/utils~getBoxSidesStyleShorthandValueReturns a shorthand notation of a CSS property value.
getBoxSidesStyleShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } ); // will return '1px 1px 2px'Copy codeParameters
__namedParameters : BoxStyleSides
Returns
string
-
getBoxSidesStyleValueReducer( styleShorthand ) → ( value: StyleValue ) => Array<StylePropertyDescriptor>module:engine/view/styles/utils~getBoxSidesStyleValueReducerDefault reducer for CSS properties that concerns edges of a box shorthand notations:
stylesProcessor.setReducer( 'padding', getBoxSidesStyleValueReducer( 'padding' ) );Copy codeParameters
styleShorthand : string
Returns
( value: StyleValue ) => Array<StylePropertyDescriptor>
-
getBoxSidesStyleValues( value ) → BoxStyleSidesmodule:engine/view/styles/utils~getBoxSidesStyleValuesParses box sides as individual values.
Parameters
value : string-
Defaults to
''
Returns
-
getPositionStyleShorthandNormalizer( shorthand ) → ( value: string ) => objectmodule:engine/view/styles/utils~getPositionStyleShorthandNormalizerCreates a normalizer for a shorthand 1-to-4 value.
stylesProcessor.setNormalizer( 'margin', getPositionStyleShorthandNormalizer( 'margin' ) );Copy codeParameters
shorthand : string
Returns
( value: string ) => object
-
getShorthandStylesValues( string ) → Array<string>module:engine/view/styles/utils~getShorthandStylesValuesParses 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)' ]Copy codeParameters
string : string
Returns
Array<string>
-
isAttachmentStyleValue( string ) → booleanmodule:engine/view/styles/utils~isAttachmentStyleValueChecks if string contains background attachment CSS value.
Parameters
string : string
Returns
boolean
-
isColorStyleValue( string ) → booleanmodule:engine/view/styles/utils~isColorStyleValueChecks 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' ); // trueCopy codeNote: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
Parameters
string : string
Returns
boolean
-
isLengthStyleValue( string ) → booleanmodule:engine/view/styles/utils~isLengthStyleValue -
isLineStyleValue( string ) → booleanmodule:engine/view/styles/utils~isLineStyleValue -
isPercentageStyleValue( string ) → booleanmodule:engine/view/styles/utils~isPercentageStyleValue -
isPositionStyleValue( string ) → booleanmodule:engine/view/styles/utils~isPositionStyleValue -
isRepeatStyleValue( string ) → booleanmodule:engine/view/styles/utils~isRepeatStyleValue -
isURLStyleValue( string ) → booleanmodule:engine/view/styles/utils~isURLStyleValue