-
Notifications
You must be signed in to change notification settings - Fork 13
style set through options and through theme sometimes clash for priority #12
Copy link
Copy link
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
The developer's own custom entry in either theme or in options should override the default values.
If the developer has passed both a theme and an option for any style prop then the the option takes priority.
Example is #6
The current code in round-headers.tsx looks like this
const Rect = styled.rect.attrs(({ theme }) => ({
fill: theme.roundHeaders.background,
}))``;
...
<Rect
x={x}
y={y + canvasPadding}
width={width}
height={roundHeader.height}
fill={roundHeader.backgroundColor}
rx="3"
ry="3"
/>Which makes it so the theme always wins even if it's the default theme against the user set value in options for roundHeaders.backgroundColor
It should be something this but more abstracted for all other values as well to centralize the logic
const Rect = styled.rect.attrs(({ theme, fill }) => ({
fill:
fill !== defaultStyle.roundHeader?.backgroundColor
? fill
: theme.roundHeaders.background,
}))``;
...
<Rect
x={x}
y={y + canvasPadding}
width={width}
height={roundHeader.height}
fill={roundHeader.backgroundColor}
rx="3"
ry="3"
/>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers