added margin prop to space component for setting margin top and button at the same time

This commit is contained in:
Grzegorz Leoniec 2018-10-11 10:16:12 +02:00
parent f344e3803a
commit 0c5f3be504

View File

@ -38,6 +38,13 @@ export default {
type: [String, Object],
default: 'large'
},
/**
* The bottom and top margin of this space.
*/
margin: {
type: [String, Object],
default: null
},
/**
* The html element name used for this space.
*/
@ -48,8 +55,11 @@ export default {
},
computed: {
styles() {
const marginTop = this.mediaQuery(this.marginTop)
const marginBottom = this.mediaQuery(this.marginBottom)
const top = this.margin ? this.margin : this.marginTop
const bottom = this.margin ? this.margin : this.marginBottom
const marginTop = this.mediaQuery(top)
const marginBottom = this.mediaQuery(bottom)
const marginTopStyle = this.parseMargin('Top')(marginTop)
const marginBottomStyle = this.parseMargin('Bottom')(marginBottom)
return {