CKEDITOR.tools.style.border
classsince 4.12.0
Represents the CSS border style.
Filtering
Properties
color : StringCKEDITOR.tools.style.border#colorRepresents the value of the CSS
colorproperty.style : StringCKEDITOR.tools.style.border#styleRepresents the value of the CSS
styleproperty.width : StringCKEDITOR.tools.style.border#widthRepresents the value of the CSS
widthproperty.
Methods
constructor( [ props ] ) → borderCKEDITOR.tools.style.border#constructorCreates a new instance of the border style.
Parameters
[ props ] : ObjectStyle-related properties.
Returns
border
Static methods
-
Parses the CSS
borderproperty shorthand format. This CSS property does not support inheritance.console.log( CKEDITOR.tools.style.border.fromCssRule( '3px solid #ffeedd' ) ); // Logs: Border { width: '3px', style: 'solid', color: '#ffeedd' }Parameters
value : StringThe
borderproperty value.Returns
borderBorder style.
static
splitCssValues( styles, [ fallback ] ) → Object.<String, border>CKEDITOR.tools.style.border#splitCssValuesParses the
style,widthandcolorshorthand styles into border side shorthand styles.var styles = { 'border-color': 'red blue', 'border-style': 'solid dotted solid', 'border-width': '1px 2px 3px 4px' }; console.log( CKEDITOR.tools.style.border.splitCssValues( styles ) ); // Logs: // { // 'border-top': Border { width: '1px', style: 'solid', color: 'red' }, // 'border-right': Border { width: '2px', style: 'dotted', color: 'blue'}, // 'border-bottom': Border { width: '3px', style: 'solid', color: 'red' }, // 'border-left': Border { width: '4px', style: 'dotted', color: 'blue' } // } // Use fallback to fill up missing style: var partialStyles = { 'border-style': 'solid', 'border-width': '2px' }, fallback = { color: 'red' }; console.log( CKEDITOR.tools.style.border.splitCssValues( partialStyles, fallback ) ); // Logs: // { // 'border-top': Border { width: '2px', style: 'solid', color: 'red' }, // 'border-right': Border { width: '2px', style: 'solid', color: 'red' }, // 'border-bottom': Border { width: '2px', style: 'solid', color: 'red' }, // 'border-left': Border { width: '2px', style: 'solid', color: 'red' } // }Border side shorthands with greater style property specificity are preferred over more general shorthands.
var styles = { 'border-style': 'solid', 'border-width': '2px', 'border-color': 'red', 'border-left-color': 'blue', 'border-right-width': '10px', 'border-top-style': 'dotted', 'border-top-color': 'green' }; console.log( CKEDITOR.tools.style.border.splitCssValues( styles ) ); // Logs: // { // 'border-top': Border { width: '2px', style: 'dotted', color: 'green' }, // 'border-right': Border { width: '10px', style: 'solid', color: 'red'}, // 'border-bottom': Border { width: '2px', style: 'solid', color: 'red' }, // 'border-left': Border { width: '2px', style: 'solid', color: 'blue' } // }Parameters
styles : ObjectBorder styles shorthand object.
[ fallback ] : ObjectFallback object used to fill up missing style.
Returns
Object.<String, border>- Properties
border-top : borderBorder top style.
border-right : borderBorder right style.
border-bottom : borderBorder bottom style.
border-left : borderBorder left style.