strip: spacing: add support for percents (#215)

This commit is contained in:
jean-emmanuel 2018-03-08 07:43:29 +01:00
parent a89f3a5bdc
commit e2a70f507a
4 changed files with 16 additions and 7 deletions

View file

@ -46,7 +46,11 @@ module.exports = class Strip extends Panel {
super(options)
this.widget.style.setProperty('--spacing', this.getProp('spacing'))
if (this.getProp('spacing')) {
var spacing = this.getProp('spacing')
if (!isNaN(spacing)) spacing += 'rem'
this.widget.style.setProperty('--spacing', spacing)
}
this.container.classList.add(this.getProp('horizontal') ? 'horizontal' : 'vertical')
if (this.getProp('stretch')) this.container.classList.add('stretch')