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: add style-source indicator for transitions section title (#3697)

Jaya Krishna Namburu3c32053c0e50
diff --git a/apps/builder/app/builder/features/style-panel/sections/transitions/transitions.tsx b/apps/builder/app/builder/features/style-panel/sections/transitions/transitions.tsx
index 66e95afb16..42aa773091 100644
--- a/apps/builder/app/builder/features/style-panel/sections/transitions/transitions.tsx
+++ b/apps/builder/app/builder/features/style-panel/sections/transitions/transitions.tsx
@@ -28,6 +28,7 @@ import {
convertIndividualTransitionToLayers,
} from "./transition-utils";
import type { StyleProperty } from "@webstudio-is/css-engine";
+import { getStyleSource } from "../../shared/style-info";
const label = "Transitions";
const initialTransition = "opacity 200ms ease 0s";
@@ -39,6 +40,13 @@ export const Section = (props: SectionProps) => {
const { currentStyle, createBatchUpdate } = props;
const [isOpen, setIsOpen] = useState(true);
const extractedProperties = getTransitionProperties(currentStyle);
+ const propertyValue = currentStyle?.["transitionProperty"]?.value;
+ const sectionStyleSource =
+ propertyValue?.type === "unparsed" ||
+ propertyValue?.type === "guaranteedInvalid"
+ ? undefined
+ : getStyleSource(currentStyle["transitionProperty"]);
+
const layers = useMemo(
() => convertIndividualTransitionToLayers(extractedProperties),
[extractedProperties]
@@ -87,7 +95,11 @@ export const Section = (props: SectionProps) => {
style={currentStyle}
description="Animate the transition between states on this instance."
properties={properties}
- label={<SectionTitleLabel>{label}</SectionTitleLabel>}
+ label={
+ <SectionTitleLabel color={sectionStyleSource}>
+ {label}
+ </SectionTitleLabel>
+ }
onReset={() =>
deleteTransitionProperties({
createBatchUpdate,