Skip to content

Commit ad09ab8

Browse files
authored
Fix scaladoc graph highlight background color in dark mode (#21814)
This PR should fix the background of the gradient that highlights the current type in the graph view in dark mode. For example on https://www.scala-lang.org/api/current/scala/annotation/ClassfileAnnotation.html you see right now a black box around the class in the graph: ![grafik](https://github.com/user-attachments/assets/ddfae1f2-c8d5-43e4-ba8b-7bb625dfec35) The right color to use here is `--background-main`: ![grafik](https://github.com/user-attachments/assets/1c316b25-c95d-48ca-a963-8b667ab21a2e) In light mode the graph looks the same as before: ![grafik](https://github.com/user-attachments/assets/1f63a3ac-e57e-49de-827a-910795c1f443) I also fixed two typos
2 parents 022b1ff + 654bc6c commit ad09ab8

File tree

1 file changed

+3
-3
lines changed
  • scaladoc/resources/dotty_res/scripts

1 file changed

+3
-3
lines changed

scaladoc/resources/dotty_res/scripts/ux.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const attrsToCopy = [
1010

1111
/**
1212
* @typedef {Object} SavedPageState
13-
* @property {Strign} mainDiv
13+
* @property {String} mainDiv
1414
* @property {String} leftColumn
1515
* @property {String} title
1616
* @property {Record<string, string>} attrs
@@ -322,7 +322,7 @@ function attachAllListeners() {
322322

323323
if (location.hash) {
324324
var target = location.hash.substring(1);
325-
// setting the 'expand' class on the top-level container causes undesireable styles
325+
// setting the 'expand' class on the top-level container causes undesirable styles
326326
// to apply to the top-level docs, so we avoid this logic for that element.
327327
if (target != "container") {
328328
var selected = document.getElementById(location.hash.substring(1));
@@ -568,7 +568,7 @@ function showGraph() {
568568
.attr("offset", "30%");
569569
radialGradient
570570
.append("stop")
571-
.attr("stop-color", "var(--background-default)")
571+
.attr("stop-color", "var(--background-main)")
572572
.attr("offset", "100%");
573573

574574
var inner = svg.append("g");

0 commit comments

Comments
 (0)