Browse Source

Only override existing color style if a color setting exists for Headings

pull/1891/head
Andrew Kingston 5 years ago
parent
commit
ab2331a291
  1. 19
      packages/standard-components/src/Heading.svelte

19
packages/standard-components/src/Heading.svelte

@ -19,12 +19,19 @@
// 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,
},
$: styles = enrichStyles($component.styles, color)
const enrichStyles = (styles, color) => {
if (!color) {
return styles
}
return {
...styles,
normal: {
...styles?.normal,
color,
},
}
}
</script>

Loading…
Cancel
Save