Skip to content

Better Code Highlighting Color Scheme Showdown #1772

Open
@sabine

Description

@sabine

Task

The color scheme for the code highlighting in the code blocks in the OCaml.org Learn area could be better.

The current color scheme is this:

Screenshot 2023-11-15 at 21-05-20 Transitioning to Multicore with TSan · OCaml Tutorials
(https://ocaml.org/docs/multicore-transition)

span[class*="keyword"] {
  color: #fede5d;
}

span[class*="constant"] {
  color: #fabd2f;
}

span[class*="function-binding"] {
  color: #36f9f6;
}

span[class*="variable"] {
  color: #85ebeb;
  font-style: italic;
}

span[class*="support"] {
  color: #83a598;
}

span[class*="comment"] {
  font-style: italic;
}

span[class*="literal"] {
  color: #d3869b;
}

span[class*="string"] {
  color: #b8bb26;
}

span[class*="numeric"] {
  color: #ff5683;
}

Respond with a new color scheme. Color scheme must meet WCAG contrast requirements. (Use a WCAG checker, e.g. https://webaim.org/resources/contrastchecker/ to check.)

When we have more than one submission, let's do an elimination game where the different color schemes face off against each other: People vote to determine the better option in rounds of pairs of two until a single champion emerges.

For the showdown, we need one code block that exhibits all the different highlight colors. I haven't checked if the code block in question here has all of the colors. If it doesn't, we need another code block to show off everything.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions