SVG Gradient
Demo
How to
- Define
<linearGradient>
- fill gradient color by using css
vue
<template>
<svg>
<defs>
<linearGradient id="linearG">
<stop offset="0%" stop-color="yellow" />
<stop offset="50%" stop-color="hotpink" />
<stop offset="100%" stop-color="deepskyblue" />
</linearGradient>
<style>
.hair-color {
fill: url('#linearG')
}
</style>
</defs>
<path class="hair-color" d="..." />
...
</svg>
<template>