Only override color style on links if a color setting exists

This commit is contained in:
Andrew Kingston 2021-07-01 00:48:40 +01:00
parent 37eca6af91
commit 49e3dce3a7
1 changed files with 15 additions and 6 deletions

View File

@ -23,13 +23,22 @@
// 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 = { // Add color styles to main styles object, otherwise the styleable helper
...$component.styles, // 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: { normal: {
...$component.styles?.normal, ...styles?.normal,
color, color,
}, },
} }
}
</script> </script>
{#if $builderStore.inBuilder || componentText} {#if $builderStore.inBuilder || componentText}