Only override existing color style if a color setting exists for Headings
This commit is contained in:
parent
9c954609fd
commit
ab2331a291
|
@ -19,13 +19,20 @@
|
|||
|
||||
// Add color styles to main styles object, otherwise the styleable helper
|
||||
// overrides the color when it's passed as inline style.
|
||||
$: styles = {
|
||||
...$component.styles,
|
||||
$: styles = enrichStyles($component.styles, color)
|
||||
|
||||
const enrichStyles = (styles, color) => {
|
||||
if (!color) {
|
||||
return styles
|
||||
}
|
||||
return {
|
||||
...styles,
|
||||
normal: {
|
||||
...$component.styles?.normal,
|
||||
...styles?.normal,
|
||||
color,
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h1
|
||||
|
|
Loading…
Reference in New Issue