Browse Source

Only override color style on links if a color setting exists

gh-pages
Andrew Kingston 5 years ago
parent
commit
49e3dce3a7
  1. 21
      packages/standard-components/src/Link.svelte

21
packages/standard-components/src/Link.svelte

@ -23,12 +23,21 @@
// Add color styles to main styles object, otherwise the styleable helper
// overrides the color when it's passed as inline style.
$: styles = {
...$component.styles,
normal: {
...$component.styles?.normal,
color,
},
// Add color styles to main styles object, otherwise the styleable helper
// overrides the color when it's passed as inline style.
$: styles = enrichStyles($component.styles, color)
const enrichStyles = (styles, color) => {
if (!color) {
return styles
}
return {
...styles,
normal: {
...styles?.normal,
color,
},
}
}
</script>

Loading…
Cancel
Save