Add wrapper component to data provider so that it can be styled

This commit is contained in:
Andrew Kingston 2021-04-29 09:41:49 +01:00
parent 5e7ba5dfb3
commit 379df050cf
2 changed files with 9 additions and 4 deletions

View File

@ -24,7 +24,10 @@ const addBuilderPreviewStyles = (node, styleString, componentId) => {
if (componentId === get(builderStore).selectedComponentId) { if (componentId === get(builderStore).selectedComponentId) {
const style = window.getComputedStyle(node) const style = window.getComputedStyle(node)
const property = style?.display === "table-row" ? "outline" : "border" const property = style?.display === "table-row" ? "outline" : "border"
return styleString + `;${property}: 2px solid #4285f4 !important;` return (
styleString +
`;${property}: 2px solid #4285f4 !important; border-radius: 4px !important;`
)
} else { } else {
return styleString return styleString
} }

View File

@ -103,6 +103,8 @@
} }
</script> </script>
<Provider {actions} data={dataContext}> <div use:styleable={$component.styles}>
<slot /> <Provider {actions} data={dataContext}>
</Provider> <slot />
</Provider>
</div>