grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Border Width Properties

Open NorthstarTech opened this issue 9 years ago • 3 comments

Is it possible to add border-top, border-right,border-left properties individually under the decoration heading in grapesjs. This would be similar to border radius.

For now it only shows the border-width which gives all sided borders. I want only right or left sided borders.

NorthstarTech avatar Nov 27 '17 12:11 NorthstarTech

Hi @NorthstarTech,

I don't have a code example, but have you looked at https://github.com/artf/grapesjs/wiki/API-Style-Manager#addproperty? There's an example there that adds "min-height" - could you modify that example to fit your needs and report back with your code if you run into trouble?

ryandeba avatar Nov 28 '17 02:11 ryandeba

@NorthstarTech Example for the right border

editor.StyleManager.addProperty('Decorations', {
  name: 'Border right',
  property: 'border-right',
  type: 'composite',
  properties: [{
    name: 'Width',
    type: 'integer',
    units: ['px', 'em', 'rem'],
    property: 'border-right-width',
  },{
    name: 'Style',
    type: 'select',
    property: 'border-right-style',
    options: [
      {value: 'none'},
      {value: 'solid'},
      {value: 'dotted'},
      {value: 'dashed'},
      {value: 'double'},
      {value: 'groove'},
      {value: 'ridge'},
      {value: 'inset'},
      {value: 'outset'}
    ]
  }, {
    name: 'Color',
    type: 'color',
    property: 'border-right-color',
  }]
});

artf avatar Nov 29 '17 22:11 artf

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 18 '19 06:09 lock[bot]