Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

remove outline on contenteditable elements

Oleg Isonena4ae1e7e9746
diff --git a/app/canvas/features/wrapper-component/use-css.tsx b/app/canvas/features/wrapper-component/use-css.tsx
index cf48cc81e4..8cafd0d257 100644
--- a/app/canvas/features/wrapper-component/use-css.tsx
+++ b/app/canvas/features/wrapper-component/use-css.tsx
@@ -46,20 +46,23 @@ const usePreviewCss = ({ instance, css }: UseCssProps) => {
return previewCss;
};
-const emptyStyle = {
+const defaultStyle = {
"&:empty": {
outline: "1px dashed #555",
outlineOffset: -1,
paddingTop: "$8",
paddingRight: "$8",
},
+ "&[contenteditable]": {
+ outline: 0,
+ },
};
export const useCss = ({ instance, css }: UseCssProps): string => {
const previewCss = usePreviewCss({ instance, css });
return useMemo(() => {
- const overrides: CSS = { ...emptyStyle };
+ const overrides: CSS = { ...defaultStyle };
for (const update of previewCss) {
if (update.value === undefined) continue;
overrides[update.property as string] = toValue(update.value);