Skip to content

Commit f4cfc50

Browse files
authored
fix(core): remove node border styles from required styles (#1954)
* fix(core): remove node border styles from required styles Signed-off-by: braks <[email protected]> * chore(changeset): add Signed-off-by: braks <[email protected]> --------- Signed-off-by: braks <[email protected]>
1 parent c977073 commit f4cfc50

File tree

3 files changed

+87
-90
lines changed

3 files changed

+87
-90
lines changed

.changeset/cyan-pandas-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-flow/core": patch
3+
---
4+
5+
Remove border related styles from the required styles and move them into the default theme stylesheet

packages/core/src/style.css

Lines changed: 59 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
z-index: 1;
2020

2121
&.draggable {
22-
cursor: grab;
23-
}
22+
cursor: grab;
23+
}
2424

2525
&.selection {
26-
cursor: pointer;
27-
}
26+
cursor: pointer;
27+
}
2828

2929
&.dragging {
3030
cursor: grabbing;
@@ -76,38 +76,38 @@
7676
cursor: pointer;
7777

7878
&.animated path {
79-
stroke-dasharray: 5;
80-
animation: dashdraw 0.5s linear infinite;
81-
}
79+
stroke-dasharray: 5;
80+
animation: dashdraw 0.5s linear infinite;
81+
}
8282

8383
&.animated path.vue-flow__edge-interaction {
84-
stroke-dasharray: none;
85-
animation: none;
86-
}
84+
stroke-dasharray: none;
85+
animation: none;
86+
}
8787

8888
&.inactive {
89-
pointer-events: none;
90-
}
89+
pointer-events: none;
90+
}
9191

9292
&.selected,
9393
&:focus,
9494
&:focus-visible {
95-
outline: none;
96-
}
95+
outline: none;
96+
}
9797

9898
&.selected .vue-flow__edge-path,
9999
&:focus .vue-flow__edge-path,
100100
&:focus-visible .vue-flow__edge-path {
101-
stroke: #555;
102-
}
101+
stroke: #555;
102+
}
103103

104104
&-textwrapper {
105-
pointer-events: all;
106-
}
105+
pointer-events: all;
106+
}
107107

108108
&-textbg {
109-
fill: white;
110-
}
109+
fill: white;
110+
}
111111

112112
&-text {
113113
pointer-events: none;
@@ -119,9 +119,9 @@
119119
pointer-events: none;
120120

121121
.animated {
122-
stroke-dasharray: 5;
123-
animation: dashdraw 0.5s linear infinite;
124-
}
122+
stroke-dasharray: 5;
123+
animation: dashdraw 0.5s linear infinite;
124+
}
125125
}
126126

127127
.vue-flow__connectionline {
@@ -133,21 +133,6 @@
133133
transform-origin: 0 0;
134134
}
135135

136-
.vue-flow__node-default,
137-
.vue-flow__node-input,
138-
.vue-flow__node-output {
139-
border-width: 1px;
140-
border-style: solid;
141-
border-color: #bbb;
142-
143-
&.selected,
144-
&:focus,
145-
&:focus-visible {
146-
outline: none;
147-
border: 1px solid #555;
148-
}
149-
}
150-
151136
.vue-flow__node {
152137
position: absolute;
153138
user-select: none;
@@ -172,14 +157,14 @@
172157
pointer-events: none;
173158

174159
&-rect {
175-
position: absolute;
176-
pointer-events: all;
177-
cursor: grab;
160+
position: absolute;
161+
pointer-events: all;
162+
cursor: grab;
178163

179164
&.dragging {
180-
cursor: grabbing;
181-
}
182-
}
165+
cursor: grabbing;
166+
}
167+
}
183168
}
184169

185170
.vue-flow__handle {
@@ -189,33 +174,33 @@
189174
min-height: 5px;
190175

191176
&.connectable {
192-
pointer-events: all;
193-
cursor: crosshair;
194-
}
177+
pointer-events: all;
178+
cursor: crosshair;
179+
}
195180

196181
&-bottom {
197-
left: 50%;
198-
bottom: 0;
199-
transform: translate(-50%, 50%);
200-
}
182+
left: 50%;
183+
bottom: 0;
184+
transform: translate(-50%, 50%);
185+
}
201186

202187
&-top {
203-
left: 50%;
204-
top: 0;
205-
transform: translate(-50%, -50%);
206-
}
188+
left: 50%;
189+
top: 0;
190+
transform: translate(-50%, -50%);
191+
}
207192

208193
&-left {
209-
top: 50%;
210-
left: 0;
211-
transform: translate(-50%, -50%);
212-
}
194+
top: 50%;
195+
left: 0;
196+
transform: translate(-50%, -50%);
197+
}
213198

214199
&-right {
215-
top: 50%;
216-
right: 0;
217-
transform: translate(50%, -50%);
218-
}
200+
top: 50%;
201+
right: 0;
202+
transform: translate(50%, -50%);
203+
}
219204
}
220205

221206
.vue-flow__edgeupdater {
@@ -229,25 +214,25 @@
229214
margin: 15px;
230215

231216
&.top {
232-
top: 0;
233-
}
217+
top: 0;
218+
}
234219

235220
&.bottom {
236-
bottom: 0;
237-
}
221+
bottom: 0;
222+
}
238223

239224
&.left {
240-
left: 0;
241-
}
225+
left: 0;
226+
}
242227

243228
&.right {
244-
right: 0;
245-
}
229+
right: 0;
230+
}
246231

247232
&.center {
248-
left: 50%;
249-
transform: translateX(-50%);
250-
}
233+
left: 50%;
234+
transform: translateX(-50%);
235+
}
251236
}
252237

253238
@keyframes dashdraw {

packages/core/src/theme-default.css

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:root {
22
--vf-node-bg: #fff;
33
--vf-node-text: #222;
4-
--vf-connection-path: #b1b1b7;
4+
--vf-connection-path: #b1b1b7;
55
--vf-handle: #555;
66
}
77

@@ -32,8 +32,8 @@
3232
.vue-flow__node.selectable {
3333
&:focus,
3434
&:focus-visible {
35-
outline: none;
36-
}
35+
outline: none;
36+
}
3737
}
3838

3939
.vue-flow__node-default,
@@ -52,8 +52,15 @@
5252

5353
&.selected,
5454
&.selected:hover {
55-
box-shadow: 0 0 0 0.5px var(--vf-box-shadow);
56-
}
55+
box-shadow: 0 0 0 0.5px var(--vf-box-shadow);
56+
}
57+
58+
&.selected,
59+
&:focus,
60+
&:focus-visible {
61+
outline: none;
62+
border: 1px solid #555;
63+
}
5764

5865
.vue-flow__handle {
5966
background: var(--vf-handle);
@@ -79,9 +86,9 @@
7986
&.selected,
8087
&:focus,
8188
&:focus-visible {
82-
outline: none;
83-
border: 1px solid var(--vf-node-color, #0041d0);
84-
}
89+
outline: none;
90+
border: 1px solid var(--vf-node-color, #0041d0);
91+
}
8592
}
8693

8794
.vue-flow__node-default {
@@ -94,9 +101,9 @@
94101
&.selected,
95102
&:focus,
96103
&:focus-visible {
97-
outline: none;
98-
border: 1px solid var(--vf-node-color, #1a192b);
99-
}
104+
outline: none;
105+
border: 1px solid var(--vf-node-color, #1a192b);
106+
}
100107
}
101108

102109
.vue-flow__node-output {
@@ -109,9 +116,9 @@
109116
&.selected,
110117
&:focus,
111118
&:focus-visible {
112-
outline: none;
113-
border: 1px solid var(--vf-node-color, #ff0072);
114-
}
119+
outline: none;
120+
border: 1px solid var(--vf-node-color, #ff0072);
121+
}
115122
}
116123

117124
.vue-flow__nodesselection-rect,
@@ -121,8 +128,8 @@
121128

122129
&:focus,
123130
&:focus-visible {
124-
outline: none;
125-
}
131+
outline: none;
132+
}
126133
}
127134

128135
.vue-flow__handle {

0 commit comments

Comments
 (0)