Added support for radianal gradiant.

This commit is contained in:
MrOnosa
2020-10-21 18:13:14 -05:00
parent 38c84d1e82
commit 1ce238722a
2 changed files with 83 additions and 95 deletions

View File

@@ -8,7 +8,7 @@ export default class Background extends React.PureComponent {
if (gradient.length > 1) {
//Note: Append the gradient for additional browser support.
const stepStyles = gradient.map(g => ` ${g.colour} ${g.stop}%`).join();
style += ` background: ${type}-gradient(${angle}deg,${stepStyles})`;
style += ` background: ${type}-gradient(${(type === 'linear' ? (`${angle}deg,`) : '')}${stepStyles})`;
}
return style;
}