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.

don't apply empty styles to void elements

Oleg Isonenaa69bbc1f872
diff --git a/app/canvas/features/wrapper-component/use-css.tsx b/app/canvas/features/wrapper-component/use-css.tsx
index 8cafd0d257..d88c7c205f 100644
--- a/app/canvas/features/wrapper-component/use-css.tsx
+++ b/app/canvas/features/wrapper-component/use-css.tsx
@@ -46,8 +46,11 @@ const usePreviewCss = ({ instance, css }: UseCssProps) => {
return previewCss;
};
+const voidElements =
+ "area, base, br, col, embed, hr, img, input, link, meta, source, track, wbr";
+
const defaultStyle = {
- "&:empty": {
+ [`&not(${voidElements}):empty`]: {
outline: "1px dashed #555",
outlineOffset: -1,
paddingTop: "$8",