Skip to content

Commit 0eec605

Browse files
committed
style: refactor styling with new classes and cleanup
- Add new classes for styling: `library`, `task`, and `multiple` - Replace inline styles with class references for various elements - Remove redundant styling properties from Producer and Consumer elements Signed-off-by: appleboy <[email protected]>
1 parent c336194 commit 0eec605

File tree

2 files changed

+122
-131
lines changed

2 files changed

+122
-131
lines changed

images/flow-01.d2

+42-51
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,30 @@ classes: {
3030
dispatch: {
3131
label: Dispatch Task
3232
}
33+
34+
library: {
35+
style: {
36+
bold: true
37+
font-size: 32
38+
fill: PapayaWhip
39+
fill-pattern: grain
40+
border-radius: 8
41+
font: mono
42+
}
43+
}
44+
45+
task: {
46+
style: {
47+
bold: true
48+
font-size: 32
49+
}
50+
}
51+
52+
multiple: {
53+
style: {
54+
multiple: true
55+
}
56+
}
3357
}
3458

3559
user01: {
@@ -70,61 +94,40 @@ container: Application {
7094

7195
task01: {
7296
icon: https://icons.terrastruct.com/essentials%2F092-graph%20bar.svg
73-
style: {
74-
multiple: true
75-
bold: true
76-
font-size: 32
77-
}
97+
class: [task; multiple]
7898
}
7999

80100
task02: {
81101
icon: https://icons.terrastruct.com/essentials%2F095-download.svg
82-
style: {
83-
multiple: true
84-
bold: true
85-
font-size: 32
86-
}
102+
class: [task; multiple]
87103
}
88104

89105
task03: {
90106
icon: https://icons.terrastruct.com/essentials%2F195-attachment.svg
91-
style: {
92-
multiple: true
93-
bold: true
94-
font-size: 32
95-
}
107+
class: [task; multiple]
96108
}
97109

98-
queue: Queue Library {
110+
queue: {
111+
label: Queue Library
99112
icon: https://icons.terrastruct.com/dev%2Fgo.svg
100113
style: {
101114
bold: true
102115
font-size: 32
103116
fill: honeydew
104117
}
105-
producer: Producer {
106-
style: {
107-
bold: true
108-
font-size: 32
109-
fill: PapayaWhip
110-
fill-pattern: grain
111-
border-radius: 8
112-
font: mono
113-
}
118+
119+
producer: {
120+
label: Producer
121+
class: library
114122
}
115123

116-
consumer: Consumer {
117-
style: {
118-
bold: true
119-
font-size: 32
120-
fill: PapayaWhip
121-
fill-pattern: grain
122-
border-radius: 8
123-
font: mono
124-
}
124+
consumer: {
125+
label: Consumer
126+
class: library
125127
}
126128

127-
database: Ring\nBuffer {
129+
database: {
130+
label: Ring\nBuffer
128131
shape: cylinder
129132
style: {
130133
bold: true
@@ -140,34 +143,22 @@ container: Application {
140143

141144
worker01: {
142145
icon: https://icons.terrastruct.com/essentials%2F092-graph%20bar.svg
143-
style: {
144-
bold: true
145-
font-size: 32
146-
}
146+
class: [task]
147147
}
148148

149149
worker02: {
150150
icon: https://icons.terrastruct.com/essentials%2F095-download.svg
151-
style: {
152-
bold: true
153-
font-size: 32
154-
}
151+
class: [task]
155152
}
156153

157154
worker03: {
158155
icon: https://icons.terrastruct.com/essentials%2F092-graph%20bar.svg
159-
style: {
160-
bold: true
161-
font-size: 32
162-
}
156+
class: [task]
163157
}
164158

165159
worker04: {
166160
icon: https://icons.terrastruct.com/essentials%2F195-attachment.svg
167-
style: {
168-
bold: true
169-
font-size: 32
170-
}
161+
class: [task]
171162
}
172163

173164
task01 -> queue.producer: {

0 commit comments

Comments
 (0)