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.

Show stateless styles when state is selected (#1602)

Bogdan Chadkinf4f0a2e984c6
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 aad46cb780..260450f3f0 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
@@ -140,6 +140,15 @@ const getSelectedStyle = (
if (instanceStyles === undefined) {
return style;
}
+ for (const styleDecl of instanceStyles) {
+ // @todo consider making stateless styles remote when state is selected
+ if (
+ styleDecl.breakpointId === breakpointId &&
+ styleDecl.state === undefined
+ ) {
+ style[styleDecl.property] = styleDecl.value;
+ }
+ }
for (const styleDecl of instanceStyles) {
if (
styleDecl.breakpointId === breakpointId &&
@@ -225,6 +234,10 @@ export const getPresetStyleRule = (
}
const presetStyle: Style = {};
for (const styleDecl of presetStyles) {
+ // @todo consider making stateless styles remote when state is selected
+ if (styleDecl.state === undefined) {
+ presetStyle[styleDecl.property] = styleDecl.value;
+ }
if (styleDecl.state === styleSourceSelector?.state) {
presetStyle[styleDecl.property] = styleDecl.value;
}