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