@@ -86,15 +86,11 @@ Below are a couple of examples on how you can do this:
86
86
87
87
Directly styling the Vue Flow component:
88
88
89
- ``` vue{5-6,8-9 }
89
+ ``` html{4-5 }
90
90
<div style="height: 300px">
91
91
<VueFlow
92
92
v-model="elements"
93
-
94
- <!-- You can pass a class name to the component -->
95
93
class="my-diagram-class"
96
-
97
- <!-- You can pass an object containing CSSProperties or CSS variables -->
98
94
:style="{ background: 'red' }"
99
95
/>
100
96
</div>
@@ -159,19 +155,29 @@ These alterations can be implemented either on a global scale or to individual e
159
155
}
160
156
```
161
157
162
- ``` js{2-3 } [<LogosJavascript />]
158
+ ``` js{6-7 } [<LogosJavascript />]
163
159
const elements = ref([
164
- /* Overriding the `--vf-node-color` variable to change node border, box-shadow and handle color */
165
- { id: '1', label: 'Node 1', position: { x: 100, y: 100 }, style: { '--vf-node-color': 'blue' } },
160
+ {
161
+ id: '1',
162
+ label: 'Node 1',
163
+ position: { x: 100, y: 100 },
164
+ /* Overriding the `--vf-node-color` variable to change node border, box-shadow and handle color */
165
+ style: { '--vf-node-color': 'blue' }
166
+ },
166
167
])
167
168
```
168
169
169
- ``` ts{4-5 } [<LogosTypescript />]
170
+ ``` ts{8-9 } [<LogosTypescript />]
170
171
import type { Elements } from '@vue-flow/core';
171
172
172
173
const elements = ref<Elements>([
173
- /* Overriding the `--vf-node-color` variable to change node border, box-shadow and handle color */
174
- { id: '1', label: 'Node 1', position: { x: 100, y: 100 }, style: { '--vf-node-color': 'blue' } },
174
+ {
175
+ id: '1',
176
+ label: 'Node 1',
177
+ position: { x: 100, y: 100 },
178
+ /* Overriding the `--vf-node-color` variable to change node border, box-shadow and handle color */
179
+ style: { '--vf-node-color': 'blue' }
180
+ },
175
181
])
176
182
```
177
183
@@ -192,40 +198,51 @@ Here's a concise list of CSS variables you can consider, along with their effect
192
198
193
199
## CSS Class Names
194
200
195
- Here you'll find a handy reference guide of class names and their respective containers:
196
-
197
- | Name | Container |
198
- | -------------------------------| ---------------------------------------------------|
199
- | .vue-flow | The outer container |
200
- | .vue-flow__ container | Wrapper for container elements |
201
- | .vue-flow__ viewport | The inner container |
202
- | .vue-flow__ transformationpane | Pane for movements like zooming and panning |
203
- | .vue-flow__ selectionpane | Pane for handling user selection |
204
- | .vue-flow__ selection | Defines current user selection box |
205
- | .vue-flow__ edges | Wrapper rendering edges |
206
- | .vue-flow__ edge | Wrapper around each edge element |
207
- | .vue-flow__ edge-{type} | Edge type (either custom or default) |
208
- | .vue-flow__ edge .selected | Defines the currently selected edge(s) |
209
- | .vue-flow__ edge .animated | Defines an animated edge |
210
- | .vue-flow__ edge-path | SVG path for edge elements |
211
- | .vue-flow__ edge-text | Wrapper around edge label |
212
- | .vue-flow__ edge-textbg | Background wrapper around edge label |
213
- | .vue-flow__ connectionline | Container for the connection line elements |
214
- | .vue-flow__ connection | Individual connection line element |
215
- | .vue-flow__ connection-path | SVG path for connection line |
216
- | .vue-flow__ nodes | Rendering wrapper around nodes |
217
- | .vue-flow__ node | Wrapper around each node element |
218
- | .vue-flow__ node .selected | Defines the currently selected node(s) |
219
- | .vue-flow__ node-{type} | Node type (either custom or default) |
220
- | .vue-flow__ nodesselection | Defines selection rectangle for nodes |
221
- | .vue-flow__ handle | Wrapper around node handle elements |
222
- | .vue-flow__ handle-bottom | Defines a handle at bottom |
223
- | .vue-flow__ handle-top | Defines a handle at top |
224
- | .vue-flow__ handle-left | Defines a handle at left |
225
- | .vue-flow__ handle-right | Defines a handle at right |
226
- | .vue-flow__ handle-connecting | Connection line is over the handle |
227
- | .vue-flow__ handle-valid | Connection line over handle with valid connection |
228
- | .vue-flow__ background | Background component |
229
- | .vue-flow__ minimap | MiniMap component |
230
- | .vue-flow__ controls | Controls component |
231
-
201
+ Here you'll find a handy reference guide of class names and their respective elements:
202
+
203
+ #### Containers
204
+ | Name | Container |
205
+ | --------------------- | ----------------------------------------- |
206
+ | .vue-flow | The outer container |
207
+ | .vue-flow__ container | Wrapper for container elements |
208
+ | .vue-flow__ viewport | The inner container |
209
+ | .vue-flow__ background | Background component |
210
+ | .vue-flow__ minimap | MiniMap component |
211
+ | .vue-flow__ controls | Controls component |
212
+
213
+ #### Edges
214
+ | Name | Description |
215
+ | ------------------------- | ------------------------------------------------- |
216
+ | .vue-flow__ edges | Wrapper rendering edges |
217
+ | .vue-flow__ edge | Wrapper around each edge element |
218
+ | .vue-flow__ selectionpane | Pane for handling user selection |
219
+ | .vue-flow__ selection | Defines current user selection box |
220
+ | .vue-flow__ edge-{type} | Edge type (either custom or default) |
221
+ | .vue-flow__ edge .selected | Defines the currently selected edge(s) |
222
+ | .vue-flow__ edge .animated | Defines an animated edge |
223
+ | .vue-flow__ edge-path | SVG path for edge elements |
224
+ | .vue-flow__ edge-text | Wrapper around edge label |
225
+ | .vue-flow__ edge-textbg | Background wrapper around edge label |
226
+ | .vue-flow__ connectionline | Container for the connection line elements |
227
+ | .vue-flow__ connection | Individual connection line element |
228
+ | .vue-flow__ connection-path| SVG path for connection line |
229
+
230
+ #### Nodes
231
+ | Name | Description |
232
+ | --------------------- | ----------------------------------------- |
233
+ | .vue-flow__ nodes | Rendering wrapper around nodes |
234
+ | .vue-flow__ node | Wrapper around each node element |
235
+ | .vue-flow__ node .selected | Defines the currently selected node(s) |
236
+ | .vue-flow__ node-{type} | Node type (either custom or default) |
237
+ | .vue-flow__ nodesselection | Defines selection rectangle for nodes |
238
+
239
+ #### Node Handles
240
+ | Name | Description |
241
+ | ------------------------- | ----------------------------------------- |
242
+ | .vue-flow__ handle | Wrapper around node handle elements |
243
+ | .vue-flow__ handle-bottom | Defines a handle at bottom |
244
+ | .vue-flow__ handle-top | Defines a handle at top |
245
+ | .vue-flow__ handle-left | Defines a handle at left |
246
+ | .vue-flow__ handle-right | Defines a handle at right |
247
+ | .vue-flow__ handle-connecting | Connection line is over the handle |
248
+ | .vue-flow__ handle-valid | Connection line over handle with valid connection |
0 commit comments