Skip to content

Commit f8e1d74

Browse files
committed
fix react flow background visibility
1 parent f5f49a6 commit f8e1d74

2 files changed

Lines changed: 29 additions & 13 deletions

File tree

src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,12 @@ const ReactFlowExampleV9: FC<ReactFlowExtendedProps> = (args) => {
459459
[reactflowInstance]
460460
);
461461

462+
const { style, ...otherProps } = args;
463+
const { height, width, ...otherStyles } = style ?? {};
464+
462465
const reactFlowExtendedProps = {
463-
...args,
466+
...otherProps,
467+
style: otherStyles,
464468
defaultZoom: 1,
465469
elements,
466470
onLoad,
@@ -470,10 +474,12 @@ const ReactFlowExampleV9: FC<ReactFlowExtendedProps> = (args) => {
470474

471475
return (
472476
<ApplicationContainer monitorDropzonesFor={args.dropzoneFor} style={{ background: "white" }}>
473-
<ReactFlowExtended {...reactFlowExtendedProps}>
474-
<MiniMap flowInstance={reactflowInstance} enableNavigation={true} />
475-
<BackgroundV9 variant={BackgroundVariantV9.Lines} gap={16} />
476-
</ReactFlowExtended>
477+
<div style={{ height, width }}>
478+
<ReactFlowExtended {...reactFlowExtendedProps}>
479+
<MiniMap flowInstance={reactflowInstance} enableNavigation={true} />
480+
<BackgroundV9 variant={BackgroundVariantV9.Dots} gap={16} />
481+
</ReactFlowExtended>
482+
</div>
477483
{edgeTools}
478484
</ApplicationContainer>
479485
);
@@ -499,7 +505,7 @@ const ReactFlowExampleV12: FC<ReactFlowExtendedProps> = (args) => {
499505
<div style={{ height, width }}>
500506
<ReactFlowExtended {...reactFlowExtendedProps}>
501507
<MiniMapV12 enableNavigation />
502-
<BackgroundV12 variant={BackgroundVariantV12.Lines} gap={16} />
508+
<BackgroundV12 variant={BackgroundVariantV12.Dots} gap={16} />
503509
</ReactFlowExtended>
504510
</div>
505511
</ApplicationContainer>

src/extensions/react-flow/_react-flow_v12.scss

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
.react-flow {
99
direction: ltr;
10+
z-index: 0;
1011
}
1112

1213
.react-flow__pane {
@@ -178,22 +179,31 @@ svg.react-flow__connectionline {
178179
pointer-events: none;
179180
background-color: $reactflow-background-color;
180181
border: solid 1px $eccgui-color-separation-divider;
182+
183+
pattern path {
184+
opacity: $eccgui-opacity-ghostly;
185+
stroke: #{eccgui-color-var("identity", "text", "300")};
186+
}
181187
}
182188

183-
.react-flow__background-pattern {
189+
.react-flow__background-pattern,
190+
.react-flow__background pattern path:first-child {
184191
opacity: $eccgui-opacity-ghostly;
192+
stroke: #{eccgui-color-var("identity", "text", "500")};
185193
}
186194

187-
.react-flow__background-pattern.dots {
188-
fill: $eccgui-color-separation-divider;
195+
.react-flow__background-pattern.dots,
196+
.react-flow__background pattern circle:first-child {
197+
opacity: $eccgui-opacity-muted;
198+
fill: #{eccgui-color-var("identity", "text", "700")};
189199
}
190200

191-
.react-flow__background-pattern.lines {
192-
stroke: $eccgui-color-separation-divider;
201+
.react-flow__background-pattern.cross {
202+
stroke: #{eccgui-color-var("identity", "text", "300")};
193203
}
194204

195-
.react-flow__background-pattern.cross {
196-
stroke: $eccgui-color-separation-divider;
205+
.react-flow__background-pattern.lines {
206+
stroke: #{eccgui-color-var("identity", "text", "300")};
197207
}
198208

199209
.react-flow__attribution {

0 commit comments

Comments
 (0)