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.

for now make outline for hover/selected look the same

Oleg Isonen9443a17cc15e
diff --git a/app/designer/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx b/app/designer/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx
index 066a588ce5..0c3e6acd57 100644
--- a/app/designer/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx
+++ b/app/designer/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx
@@ -36,11 +36,7 @@ export const HoveredInstanceOutline = () => {
return (
<Outline style={style}>
- <Label
- component={instanceData.component}
- instanceRect={instanceRect}
- state="hovered"
- />
+ <Label component={instanceData.component} instanceRect={instanceRect} />
</Outline>
);
};
diff --git a/app/designer/features/workspace/canvas-tools/outline/label.tsx b/app/designer/features/workspace/canvas-tools/outline/label.tsx
index 3624bcebb3..bf6add852b 100644
--- a/app/designer/features/workspace/canvas-tools/outline/label.tsx
+++ b/app/designer/features/workspace/canvas-tools/outline/label.tsx
@@ -49,17 +49,10 @@ const LabelContainer = styled(
lineHeight: 1,
minWidth: "$6",
whiteSpace: "nowrap",
+ backgroundColor: "$blue9",
},
{
variants: {
- state: {
- selected: {
- backgroundColor: "$blue9",
- },
- hovered: {
- color: "$blue9",
- },
- },
position: {
top: {
top: "-$4",
@@ -78,15 +71,14 @@ const LabelContainer = styled(
type LabelProps = {
component: Instance["component"];
instanceRect: DOMRect;
- state: "hovered" | "selected";
};
-export const Label = ({ component, instanceRect, state }: LabelProps) => {
+export const Label = ({ component, instanceRect }: LabelProps) => {
const [labelRef, position] = useLabelPosition(instanceRect);
const primitive = primitives[component];
const { Icon } = primitive;
return (
- <LabelContainer state={state} position={position} ref={labelRef}>
+ <LabelContainer position={position} ref={labelRef}>
<Icon width="1em" height="1em" />
{primitive.label}
</LabelContainer>
diff --git a/app/designer/features/workspace/canvas-tools/outline/selected-instance-outline.tsx b/app/designer/features/workspace/canvas-tools/outline/selected-instance-outline.tsx
index 7f26f960df..267c09b233 100644
--- a/app/designer/features/workspace/canvas-tools/outline/selected-instance-outline.tsx
+++ b/app/designer/features/workspace/canvas-tools/outline/selected-instance-outline.tsx
@@ -31,11 +31,7 @@ export const SelectedInstanceOutline = () => {
return (
<Outline style={style}>
- <Label
- component={instanceData.component}
- instanceRect={instanceRect}
- state="selected"
- />
+ <Label component={instanceData.component} instanceRect={instanceRect} />
</Outline>
);
};