gitlab-org--gitlab-foss/app/assets/javascripts/vue_shared/components/svg_gradient.vue
Sarah Groff Hennigh-Palermo 9bb41e894e Adds EE validators to CE file
2019-03-29 09:00:16 +00:00

34 lines
703 B
Vue

<script>
export default {
props: {
colors: {
type: Array,
required: true,
validator(value) {
return value.length === 2;
},
},
opacity: {
type: Array,
required: true,
validator(value) {
return value.length === 2;
},
},
identifierName: {
type: String,
required: true,
},
},
};
</script>
<template>
<svg height="0" width="0">
<defs>
<linearGradient :id="identifierName">
<stop :stop-color="colors[0]" :stop-opacity="opacity[0]" offset="0%" />
<stop :stop-color="colors[1]" :stop-opacity="opacity[1]" offset="100%" />
</linearGradient>
</defs>
</svg>
</template>