Skip to content

Commit e0c7951

Browse files
sneakers-the-ratlwasser
authored andcommitted
colors for hovertext in light and dark mode
1 parent ea01a9b commit e0c7951

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

_ext/translation_graph.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,14 @@ def run(self):
143143
)
144144
# Create figure
145145
fig = go.Figure(data=heatmap)
146+
147+
# plotly only lets us use css variables for colors in some places,
148+
# and plotly otherwise inlines a lot of CSS itself.
149+
# so colors are partially specified here, and partially (forcefully)
150+
# overridden in _static/pyos.css
146151
fig.update_layout(
147152
paper_bgcolor="rgba(0,0,0,0)",
148153
plot_bgcolor="rgba(0,0,0,0)",
149-
hoverlabel_bgcolor="var(--bs-body-bg)",
150-
hoverlabel_font_color="var(--bs-body-color)",
151-
font_color="var(--bs-body-color)",
152154
margin=dict(l=40, r=40, t=40, b=40),
153155
xaxis_showgrid=False,
154156
xaxis_side="top",

_static/pyos.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,11 @@ th {
428428
fill: var(--pst-color-text-base) !important;
429429
}
430430

431+
g.hovertext > path:first-child {
432+
fill: var(--pst-color-background) !important;
433+
stroke: var(--pst-color-border) !important;
434+
}
435+
431436
@media (max-width: 540px) {
432437
g.heatmap-label > text {
433438
display: none;

0 commit comments

Comments
 (0)