online-judge icon indicating copy to clipboard operation
online-judge copied to clipboard

Dark mode online judge

Open int-y1 opened this issue 2 years ago • 12 comments

This is for the many users who requested dark mode. This issue is possibly a subset of #578.

A few general guidelines:

  • I will try to keep this description up to date. For any bugs that I missed, feel free to post them in this issue.
  • Feel free to make a PR for any of these bugs. A few tips to make review easier:
    • If you're working with SCSS, you'll find these files useful: /resources/vars-*.scss
    • You can put Part of #2035 in your PR description. Don't put Closes #2035/Fixes #2035.
    • Post a screenshot of before change + after change.
    • For small changes, average review time is ~2 days. For big changes, review will take longer.

Important styling bugs:

  • [ ] https://dmoj.ca/problem/2dperm Blockquote sidebar is too dark. (Thanks, @Xyene)
  • [ ] https://dmoj.ca/edit/profile/ The editor's header and sidebars are light.

Less important styling bugs:

  • [ ] https://dmoj.ca/stats/language/?dark Pie chart's labels are black.
  • [ ] When hovering over the X on alerts (e.g., https://dmoj.ca/problem/cco21p6/tickets/new), the X blends in to the background. It's also pretty light to begin with. (Thanks, @Xyene)
  • [ ] Images need background-color: white; because the image may have transparency.
  • [ ] https://dmoj.ca/edit/profile/ Set site theme to dark and disable experimental features. The editor uses dark mode. (Thanks, @Riolku)

When you're bored:

  • Go to /edit/profile/, enable experimental features, and set site theme to dark. Visit any page, and try to find styling bugs.
  • Find page-specific <style> with git grep -n "<style". At a minimum, migrate the color-specific properties into scss file(s).

int-y1 avatar Nov 13 '22 11:11 int-y1

This issue has reached a milestone.

The site will serve dark mode if the user specifies ?dark in the URL. For example: https://dmoj.ca/problem/aplusb?dark This new feature is intended for developers who want to test in prod, and work on this issue. There is a lot of work remaining. Possible future milestones:

  • Dark mode looks ok when a logged-out user is browsing the site.
  • Dark mode looks ok when a new user is browsing the site.
  • Dark mode looks ok when an admin is browsing the site.
  • A user can specify dark mode in /edit/profile/.

int-y1 avatar Dec 17 '22 08:12 int-y1

  • [x] SVG/PNG math isn't color-inverted, though MathJax is. The PNG may fall under image color inversion.

Xyene avatar Jan 01 '23 07:01 Xyene

  • [x] User profile images should have a background set, see e.g. comments on https://dmoj.ca/problem/fibonacci

This is a subset of

Images need background-color: white; because the image may have transparency.

but we might want to address it separately, since images in problem statements may be fine with color inversion.

  • [x] Text fields are black, but checkboxes and select2 fields are not, e.g. on https://dmoj.ca/problems/

Xyene avatar Jan 02 '23 18:01 Xyene

This might be a little nitpicky, but purple text can be hard to read against the dark background image Lightening the color in dark mode to something like #a600a6 (from #800080) would help image Same for blue users, though I don't have a better suggestions for it image

jdabtieu avatar Jan 04 '23 06:01 jdabtieu

Here's a CSS export of pygment's github-dark theme: https://gist.github.com/Xyene/e0cac053b28507cd5e65478ae44eba22

This could be used in place of https://github.com/DMOJ/online-judge/blob/master/resources/pygment-github.css

image

Xyene avatar Jan 08 '23 06:01 Xyene

  • [ ] Grading / processing submission status rows are janky

Screenshot_20230108-162850~2

Unsure if we want to just invert the spinner colors, or set a background on the row.

Xyene avatar Jan 08 '23 21:01 Xyene

image

  • [ ] Use a different default editor theme for dark mode.

Ninjaclasher avatar Feb 05 '23 19:02 Ninjaclasher

We should import more ace.js themes, upstream has many more dark themes than we do: https://ace.c9.io/build/kitchen-sink.html

Maybe we should add a "Default" editor theme, that does different things for light/dark mode?

Xyene avatar Feb 05 '23 19:02 Xyene

  • [ ] Blockquote sidebar is too dark, I think we want to make it lighter than the background rather than darker:
image

Xyene avatar Feb 05 '23 20:02 Xyene

  • [ ] When hovering over the X on alerts (e.g., https://dmoj.ca/problem/cco21p6/tickets/new), the X blends in to the background. It's also pretty light to begin with.
  • [ ] We should soften whites and blacks, e.g.
image

instead of

image

Headers should be brighter than the content they are heading.

Xyene avatar Feb 06 '23 05:02 Xyene

image Here's a bug where the editor is dark even though experimental features aren't on.

Riolku avatar Feb 09 '23 03:02 Riolku

Header of the user-script editor is light when dark mode is on. Also not a bug, but could we get darker scrollbars in dark mode? image

jdabtieu avatar Feb 22 '23 23:02 jdabtieu