gitlab-org--gitlab-foss/app/assets/javascripts/vue_shared/components/svg_gradient.vue

35 lines
703 B
Vue
Raw Normal View History

2018-06-21 16:41:20 -04:00
<script>
export default {
props: {
colors: {
type: Array,
required: true,
2019-03-29 05:00:16 -04:00
validator(value) {
return value.length === 2;
},
2018-06-21 16:41:20 -04:00
},
opacity: {
type: Array,
required: true,
2019-03-29 05:00:16 -04:00
validator(value) {
return value.length === 2;
},
2018-06-21 16:41:20 -04:00
},
identifierName: {
type: String,
required: true,
},
},
};
</script>
<template>
2018-11-16 15:07:38 -05:00
<svg height="0" width="0">
2018-06-21 16:41:20 -04:00
<defs>
2018-11-16 15:07:38 -05:00
<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%" />
2018-06-21 16:41:20 -04:00
</linearGradient>
</defs>
</svg>
</template>