Skip to content

Commit fecd572

Browse files
committed
Emit css even not in embed mode, and update README images.
1 parent f025e63 commit fecd572

6 files changed

+72
-10
lines changed

examples/linearizability_1.2.a.svg

+12
Loading

examples/linearizability_1.2.b.svg

+12
Loading

examples/linearizability_1.2.c.svg

+12
Loading

examples/linearizability_1.2.d.svg

+12
Loading

examples/ophistory_all.svg

+13-1
Loading

ophistory.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -274,22 +274,24 @@ def spans_to_chart(spaninfo : SpanInfo) -> Chart:
274274

275275
def svg_header(width : Dimension, height : Dimension) -> str:
276276
header = f'''<svg version="1.1" width="{width}" height="{height}" xmlns="http://www.w3.org/2000/svg">'''
277-
if EMBED:
278-
header += textwrap.dedent("""
279-
<defs>
280-
<style type="text/css">
281-
text {
282-
font-size: 12px;
283-
font-family: monospace;
284-
}
277+
header += textwrap.dedent("""
278+
<defs>
279+
<style type="text/css">
285280
@media (prefers-color-scheme: dark) {
286281
text {
287282
fill: #eceff4;
288283
}
289284
line {
290285
stroke: #eceff4;
291286
}
292-
}
287+
}""")
288+
if EMBED:
289+
header += textwrap.dedent("""
290+
text {
291+
font-size: 12px;
292+
font-family: monospace;
293+
}""")
294+
header += textwrap.dedent("""
293295
</style>
294296
</defs>""")
295297
return header

0 commit comments

Comments
 (0)