1
0
Fork 0
mirror of synced 2024-07-03 05:20:32 +12:00

Only override color style on paragraphs if a color setting exists

This commit is contained in:
Andrew Kingston 2021-07-01 00:48:05 +01:00
parent 26ed9da4de
commit 7e8bdae875

View file

@ -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>