Skip to content

Commit ca6fea0

Browse files
Update tutorial.
1 parent c7d4be3 commit ca6fea0

File tree

9 files changed

+20
-18
lines changed

9 files changed

+20
-18
lines changed

dsl/02-tutorial.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,25 +260,30 @@ Styling elements can be achieved by creating an [element style](/dsl/cookbook/el
260260
261261
styles {
262262
element "Element" {
263-
color white
263+
color #0773af
264+
stroke #0773af
265+
strokeWidth 7
266+
shape roundedbox
264267
}
265268
element "Person" {
266-
background #116611
267269
shape person
268270
}
269-
element "Software System" {
270-
background #2D882D
271+
element "Boundary" {
272+
strokeWidth 5
273+
}
274+
relationship "Relationship" {
275+
thickness 4
271276
}
272277
}
273278
}
274279
```
275280

276281
This code:
277282

278-
- sets the foreground colour of all elements to white
279-
- sets the background colour of all software systems to green
280-
- sets the background colour of all people to a darker green
283+
- sets the foreground colour and stroke of all elements to #0773af (blue)
281284
- sets the shape of all people to a person shape
285+
- increases the line thickness for boundary boxes (e.g. the dashed line that shows the software system boundary on a container diagram)
286+
- increases the line thickness for relationships
282287

283288
[![](/dsl/tutorial/5-1.png)](http://structurizr.com/dsl?src=https://docs.structurizr.com/dsl/tutorial/5.dsl&view=Diagram1)
284289

@@ -299,17 +304,12 @@ And then we can define an element style for that `Database` tag.
299304
```
300305
styles {
301306
...
302-
element "Container" {
303-
background #55aa55
304-
}
305307
element "Database" {
306308
shape cylinder
307309
}
308310
}
309311
```
310312

311-
We have additionally added an element style for the `Container` tag, to set the colour of all containers to a lighter green.
312-
313313
[![](/dsl/tutorial/5-2.png)](http://structurizr.com/dsl?src=https://docs.structurizr.com/dsl/tutorial/5.dsl&view=Diagram2)
314314

315315
Clicking the "i" button inside the diagram editor will reveal the automatically generated diagram key for that particular diagram.

dsl/tutorial/1.png

1.64 KB
Loading

dsl/tutorial/2-1.png

1.64 KB
Loading

dsl/tutorial/2-2.png

2.77 KB
Loading

dsl/tutorial/3-1.png

1.64 KB
Loading

dsl/tutorial/5-1.png

7.24 KB
Loading

dsl/tutorial/5-2.png

7.27 KB
Loading

dsl/tutorial/5-3.png

3.33 KB
Loading

dsl/tutorial/5.dsl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@ workspace "Name" "Description"
2828

2929
styles {
3030
element "Element" {
31-
color white
31+
color #0773af
32+
stroke #0773af
33+
strokeWidth 7
34+
shape roundedbox
3235
}
3336
element "Person" {
34-
background #116611
3537
shape person
3638
}
37-
element "Software System" {
38-
background #2D882D
39+
element "Boundary" {
40+
strokeWidth 5
3941
}
40-
element "Container" {
41-
background #55aa55
42+
relationship "Relationship" {
43+
thickness 4
4244
}
4345
element "Database" {
4446
shape cylinder

0 commit comments

Comments
 (0)