kdzwinel/SnappySnippet

`border` property invalid when shorthand filter used

kdzwinel opened this issue · 1 comments

When nodes border isn't the same for all edges getComputedStyle returns empty value for shorthand property border. It make sense because border property does allow setting only one style of border for all edges.

Workaround needed.

https://developer.mozilla.org/en-US/docs/Web/CSS/border

Note to self:

if(border === '') {
  for(style in [borderTop, borderLeft, borderBottom, borderRight]) {
    if(style !== '') {
      output += style;
    }
  }
}