Skip to content

Commit

Permalink
Fix scaladoc graph highlight background color in dark mode (scala#21814)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bracevac authored Oct 20, 2024
2 parents 022b1ff + 654bc6c commit ad09ab8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scaladoc/resources/dotty_res/scripts/ux.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const attrsToCopy = [

/**
* @typedef {Object} SavedPageState
* @property {Strign} mainDiv
* @property {String} mainDiv
* @property {String} leftColumn
* @property {String} title
* @property {Record<string, string>} attrs
Expand Down Expand Up @@ -322,7 +322,7 @@ function attachAllListeners() {

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

var inner = svg.append("g");
Expand Down

0 comments on commit ad09ab8

Please sign in to comment.