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.

Fix preset styles (#1556)

Bogdan Chadkinf82bd6f22e3f
diff --git a/apps/builder/app/builder/features/style-panel/shared/style-info.ts b/apps/builder/app/builder/features/style-panel/shared/style-info.ts
index e30166ac10..4478f8b015 100644
--- a/apps/builder/app/builder/features/style-panel/shared/style-info.ts
+++ b/apps/builder/app/builder/features/style-panel/shared/style-info.ts
@@ -245,13 +245,7 @@ export const getInheritedInfo = (
selectedBreakpointId,
];
- const ancestorInstanceStyles = stylesByInstanceId.get(ancestorInstance.id);
- if (ancestorInstanceStyles === undefined) {
- continue;
- }
-
const tagName = selectedInstanceIntanceToTag.get(instanceId);
-
const component = getInstanceComponent(instances, instanceId);
const presetStyle =
tagName !== undefined && component !== undefined
@@ -271,6 +265,11 @@ export const getInheritedInfo = (
}
}
+ const ancestorInstanceStyles = stylesByInstanceId.get(ancestorInstance.id);
+ if (ancestorInstanceStyles === undefined) {
+ continue;
+ }
+
// extract styles from all active breakpoints
for (const breakpointId of cascadedAndSelectedBreakpointIds) {
for (const styleDecl of ancestorInstanceStyles) {