Skip to content

Commit 9ca08e0

Browse files
committed
var(--plot-background) (#1513)
1 parent 5638a17 commit 9ca08e0

File tree

602 files changed

+889
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

602 files changed

+889
-231
lines changed

docs/.vitepress/theme/custom.css

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,16 @@
4040

4141
.vp-doc .plot,
4242
.vp-doc .plot-ramp {
43+
--plot-background: var(--vp-c-bg);
4344
overflow: visible;
4445
position: relative;
4546
z-index: 1;
4647
}
4748

49+
.vp-doc .plot [aria-label="tip"] {
50+
--plot-background: var(--vp-c-bg-alt);
51+
}
52+
4853
.vp-doc .plot-figure {
4954
margin: 16px 0 0;
5055
}
@@ -70,20 +75,6 @@
7075
text-decoration: initial;
7176
}
7277

73-
:root [aria-label="tip"][fill="white"],
74-
:root [aria-label="tip"] [fill="white"] {
75-
fill: var(--vp-c-bg-alt);
76-
}
77-
78-
:root.dark marker[stroke="white"],
79-
:root.dark [aria-label^="crosshair"][stroke="white"] {
80-
stroke: var(--vp-c-bg);
81-
}
82-
83-
:root.dark marker[fill="white"] {
84-
fill: var(--vp-c-bg);
85-
}
86-
8778
.vp-doc :not(pre) > code {
8879
line-height: 1.5;
8980
}

src/marker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function markerCircleFill(color, context) {
6161
.attr("markerWidth", 6.67)
6262
.attr("markerHeight", 6.67)
6363
.attr("fill", color)
64-
.attr("stroke", "white")
64+
.attr("stroke", "var(--plot-background)")
6565
.attr("stroke-width", 1.5)
6666
.call((marker) => marker.append("circle").attr("r", 3))
6767
.node();
@@ -72,7 +72,7 @@ function markerCircleStroke(color, context) {
7272
.attr("viewBox", "-5 -5 10 10")
7373
.attr("markerWidth", 6.67)
7474
.attr("markerHeight", 6.67)
75-
.attr("fill", "white")
75+
.attr("fill", "var(--plot-background)")
7676
.attr("stroke", color)
7777
.attr("stroke-width", 1.5)
7878
.call((marker) => marker.append("circle").attr("r", 3))

src/marks/crosshair.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function textOptions(k, pointerOptions, options) {
8585
color = "currentColor",
8686
textFill: fill = color,
8787
textFillOpacity: fillOpacity,
88-
textStroke: stroke = "white",
88+
textStroke: stroke = "var(--plot-background)",
8989
textStrokeOpacity: strokeOpacity,
9090
textStrokeWidth: strokeWidth = 5
9191
} = options;

src/marks/tip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {cut, clipper, splitter, maybeTextOverflow} from "./text.js";
1414

1515
const defaults = {
1616
ariaLabel: "tip",
17-
fill: "white",
17+
fill: "var(--plot-background)",
1818
stroke: "currentColor"
1919
};
2020

src/marks/tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function tree(
2424
markerEnd = marker,
2525
dot: dotDot = isNoneish(markerStart) && isNoneish(markerEnd),
2626
text: textText = "node:name",
27-
textStroke = "white",
27+
textStroke = "var(--plot-background)",
2828
title = "node:path",
2929
dx,
3030
dy,

src/plot.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export function plot(options = {}) {
258258
// Warning: if you edit this, change defaultClassName.
259259
svg.append("style").text(
260260
`.${className} {
261+
--plot-background: white;
261262
display: block;
262263
height: auto;
263264
height: intrinsic;

test/output/aaplBollinger.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplBollingerCandlestick.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplBollingerGridInterval.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplBollingerGridSpacing.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCandlestick.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplChangeVolume.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplClose.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseClip.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseDataTicks.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseGridColor.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseGridInterval.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseGridIntervalName.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseGridIterable.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseImplicitGrid.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseNormalize.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplCloseUntyped.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplFancyAxis.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplInterval.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplMonthly.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplVolume.svg

Lines changed: 1 addition & 0 deletions

test/output/aaplVolumeRect.svg

Lines changed: 1 addition & 0 deletions

test/output/anscombeQuartet.svg

Lines changed: 1 addition & 0 deletions

test/output/arcCollatz.svg

Lines changed: 1 addition & 0 deletions

test/output/arcCollatzUp.svg

Lines changed: 1 addition & 0 deletions

test/output/arcMiserables.svg

Lines changed: 1 addition & 0 deletions

test/output/armadillo.svg

Lines changed: 1 addition & 0 deletions

test/output/aspectRatioBand.svg

Lines changed: 1 addition & 0 deletions

test/output/aspectRatioLinear.svg

Lines changed: 1 addition & 0 deletions

test/output/aspectRatioLog.svg

Lines changed: 1 addition & 0 deletions

test/output/aspectRatioPoint.svg

Lines changed: 1 addition & 0 deletions

test/output/aspectRatioSqrt.svg

Lines changed: 1 addition & 0 deletions

test/output/athletesBinsColors.svg

Lines changed: 1 addition & 0 deletions

test/output/athletesBirthdays.svg

Lines changed: 1 addition & 0 deletions

test/output/athletesBoxingHeight.svg

Lines changed: 1 addition & 0 deletions

test/output/athletesHeightWeight.svg

Lines changed: 1 addition & 0 deletions

test/output/athletesHeightWeightBin.svg

Lines changed: 1 addition & 0 deletions

test/output/athletesHeightWeightBinStroke.svg

Lines changed: 1 addition & 0 deletions

test/output/athletesHeightWeightSex.svg

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)