Skip to content
Snippets Groups Projects
Unverified Commit 5eadb33d authored by Dalton's avatar Dalton Committed by GitHub
Browse files

Remove value-label-outline text (#22208)

parent 48241e6c
Branches
Tags
No related merge requests found
......@@ -337,12 +337,7 @@
background-color: color-mod(var(--color-bg-white) alpha(-86%));
}
.Dashboard--night text.value-label-outline {
stroke: var(--night-mode-card);
}
.Dashboard text.value-label,
.Dashboard text.value-label-outline,
.Dashboard text.value-label-white,
.Dashboard .LineAreaBarChart .dc-chart .axis text {
font-size: 12px;
......
......@@ -228,19 +228,10 @@
stroke-dasharray: 5, 5;
}
text.value-label-outline,
text.value-label {
pointer-events: none;
}
text.value-label-outline {
font-weight: 800;
font-size: 12px;
letter-spacing: 0.5px;
stroke-width: 3px;
stroke: var(--color-text-white);
}
text.value-label {
fill: var(--color-text-dark);
font-size: 12px;
......
......@@ -283,11 +283,7 @@ export function onRenderValueLabels(
return transforms.join(" ");
});
// Labels are either white inside the bar or black with white outline.
// For outlined labels, Safari had an issue with rendering paint-order: stroke.
// To work around that, we create two text labels: one for the the black text
// and another for the white outline behind it.
["value-label-outline", "value-label", "value-label-white"].forEach(klass =>
["value-label", "value-label-white"].forEach(klass =>
labelGroups
.append("text")
// only create labels for the correct class(es) given the type of label
......@@ -320,7 +316,7 @@ export function onRenderValueLabels(
addLabels(sample, compactForSeries[index]);
const totalWidth = chart
.svg()
.selectAll(".value-label-outline")
.selectAll(".value-label, .value-label-white")
.flat()
.reduce((sum, label) => sum + label.getBoundingClientRect().width, 0);
const labelWidth = totalWidth / sample.length + LABEL_PADDING;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment