Skip to content

Commit 2f0db0b

Browse files
committed
Draw outlines and text separately
1 parent d36cf00 commit 2f0db0b

File tree

1 file changed

+46
-51
lines changed

1 file changed

+46
-51
lines changed

_tools/release_cycle_template.svg.jinja

Lines changed: 46 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
stroke-width: 0.8px;
3434
opacity: 75%;
3535
}
36-
.release-cycle-year-text {
37-
fill: var(--svg-color-foreground-primary);
38-
}
3936
.release-cycle-today-line {
4037
stroke: var(--svg-color-brand-primary);
4138
stroke-width: var(--blob-border-width);
@@ -44,36 +41,30 @@
4441
fill: var(--svg-color-background-item);
4542
opacity: 50%;
4643
}
47-
.release-cycle-version-label {
48-
fill: var(--svg-color-foreground-primary);
49-
}
5044
.release-cycle-blob {
5145
stroke-width: var(--blob-border-width);
5246
}
53-
text {
47+
.text-main {
5448
fill: var(--svg-color-foreground-primary);
5549
50+
/* use specific colours on known backgrounds */
51+
&.release-cycle-status-security,
52+
&.release-cycle-status-bugfix {
53+
fill: black;
54+
}
55+
}
56+
.text-outline {
5657
/* an outline of the background color, in case it's not set
57-
correctly */
58+
correctly */
59+
fill: transparent;
5860
stroke: var(--svg-color-background-primary);
5961
stroke-width: var(--blob-border-width);
60-
/* draw stroke first (half of it will be visible as outline) */
61-
paint-order: stroke;
6262
6363
/* use specific colours on known backgrounds */
64-
&.release-cycle-status-security ,
64+
&.release-cycle-status-security,
6565
&.release-cycle-status-bugfix {
66-
fill: black;
6766
stroke: var(--status-bg-color);
6867
}
69-
/* For year labels, keep outline below the row shading
70-
(it's a separate element) */
71-
&.release-cycle-version-label-outline {
72-
fill: transparent;
73-
}
74-
&.release-cycle-version-label {
75-
stroke: none;
76-
}
7768
}
7869
.release-cycle-status-end-of-life {
7970
--status-bg-color: #DD2200;
@@ -120,7 +111,7 @@
120111
{% set y = version.y * line_height %}
121112
<!-- Outline for legend on the left -->
122113
<text
123-
class="release-cycle-version-label-outline"
114+
class="release-cycle-version-label text-outline"
124115
x="{{ 0.5 * SCALE }}"
125116
y="{{ version.y * line_height }}"
126117
font-size="{{ SCALE }}"
@@ -141,15 +132,17 @@
141132
{% endfor %}
142133

143134
{% for year in years %}
144-
<text
145-
class="release-cycle-year-text"
146-
x="{{ (year_to_x(year) + year_to_x(year + 1)) / 2 }}"
147-
y="{{ diagram_height - line_height }}"
148-
font-size="{{ SCALE * 0.75 }}"
149-
text-anchor="middle"
150-
>
151-
{{ format_year(year) }}
152-
</text>
135+
{% for cls in ('text-outline', 'text-main') %}
136+
<text
137+
class="release-cycle-year-text {{cls}}"
138+
x="{{ (year_to_x(year) + year_to_x(year + 1)) / 2 }}"
139+
y="{{ diagram_height - line_height }}"
140+
font-size="{{ SCALE * 0.75 }}"
141+
text-anchor="middle"
142+
>
143+
{{ format_year(year) }}
144+
</text>
145+
{% endfor %}
153146
{% if not loop.last %}
154147
<line
155148
class="release-cycle-year-line"
@@ -284,30 +277,32 @@
284277
{% set small_text_y = version.y * line_height - 0.1 * SCALE %}
285278

286279
<!-- Add text before/after/inside the blob -->
287-
<text
288-
class="release-cycle-blob-label release-cycle-status-{{ version.status }}"
289-
font-size="{{ SCALE * 0.75 }}"
290-
y="{{ small_text_y }}"
291-
{% if version.status == "bugfix" %}
292-
x="{{ (start_x + middle_x) / 2 }}"
293-
text-anchor="middle"
294-
{% elif version.status == "security" %}
295-
x="{{ (middle_x + end_x) / 2 }}"
296-
text-anchor="middle"
297-
{% elif version.status == "end-of-life" %}
298-
x="{{ end_x + (0.25 * SCALE) }}"
299-
text-anchor="start"
300-
{% else %}
301-
x="{{ start_x - (0.25 * SCALE) }}"
302-
text-anchor="end"
303-
{% endif %}
304-
>
305-
{{ version.status }}
306-
</text>
280+
{% for cls in ('text-outline', 'text-main') %}
281+
<text
282+
class="release-cycle-blob-label {{cls}} release-cycle-status-{{ version.status }}"
283+
font-size="{{ SCALE * 0.75 }}"
284+
y="{{ small_text_y }}"
285+
{% if version.status == "bugfix" %}
286+
x="{{ (start_x + middle_x) / 2 }}"
287+
text-anchor="middle"
288+
{% elif version.status == "security" %}
289+
x="{{ (middle_x + end_x) / 2 }}"
290+
text-anchor="middle"
291+
{% elif version.status == "end-of-life" %}
292+
x="{{ end_x + (0.25 * SCALE) }}"
293+
text-anchor="start"
294+
{% else %}
295+
x="{{ start_x - (0.25 * SCALE) }}"
296+
text-anchor="end"
297+
{% endif %}
298+
>
299+
{{ version.status }}
300+
</text>
301+
{% endfor %}
307302

308303
<!-- Legend on the left -->
309304
<text
310-
class="release-cycle-version-label"
305+
class="release-cycle-version-label text-main"
311306
x="{{ 0.5 * SCALE }}"
312307
y="{{ version.y * line_height }}"
313308
font-size="{{ SCALE }}"

0 commit comments

Comments
 (0)