p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

Support for Dark Theme

Open Prateek93a opened this issue 3 years ago • 10 comments

Currently the website only has a default theme. I am not sure but I believe it would be nice to have support for dark theme as well.

Prateek93a avatar Mar 14 '21 18:03 Prateek93a

I'd be happy to work on this feature.

niemenjoki avatar Mar 15 '21 13:03 niemenjoki

I'm just thinking out loud, but if it's going to be implemented what about adding high contrast mode too to be consistent with the web editor? https://github.com/processing/p5.js-web-editor/issues/1263

micuat avatar Mar 15 '21 16:03 micuat

thanks everyone! i assigned @jnsjknn for this issue

montoyamoraga avatar Mar 15 '21 17:03 montoyamoraga

I have now created new dark and high contrast themes. I did my best to match the colors in the web editor for consistency. Currently, the theme can only be changed by editing the classList of the body element:

document.body.classList = "light"
document.body.classList = "dark"
document.body.classList = "contrast"

It may be a good idea for someone more experienced to see if my implementation is ok. Can someone check it by cloning my fork or how should we proceed @montoyamoraga?

TODO / thoughts:

  • The color p5.js logo doesn't match the yellow color of the high contrast theme. Should we
    • add a new asset
    • use CSS filters to change the color
    • leave it as it is
    • something else?
  • The asterisk svg on the page has the same problem as mentioned above about the logo
  • How should the theme change?
    • Automatically based on prefers-color-scheme
    • Allowing users to manually change it with a toggle somewhere on the site
    • Initially changing the theme automatically but allowing user to override it
  • Should we store the preferred theme in localStorage or sessionStorage to preserve the user's selection?

niemenjoki avatar Mar 16 '21 13:03 niemenjoki

Are there any further details on the availability of the website's dark theme? This thread seems to indicate that one was attempted, but no affordance was made for selecting it.

Is there any place to download the work already completed? The fork previously linked is dead.

One would think that an explicitly accommodating project such as this would have made accessibility a first priority, so it's absolutely astounding that the readability of the website is so blindingly poor.

ace-johnny avatar Aug 10 '21 21:08 ace-johnny

@ace-johnny No details. I don't think my work was ever reviewed by anyone and eventually I forgot about it. Later I ended up deleting the fork without realizing that it had the dark mode code in it.

niemenjoki avatar Aug 11 '21 05:08 niemenjoki

I'm happy to review a PR for this if there are existing work already done or if a new attempt is made.

limzykenneth avatar Aug 11 '21 13:08 limzykenneth

@limzykenneth Is this feature of Dark mode still needed in the p5 website? I can work on this.

akshatnema avatar Jan 23 '22 12:01 akshatnema

@akshatnema I don't know if the p5 team still needs it, but I sure do. My CSS skills just aren't up to the task of redesigning the entire site; let me know if you make an attempt.

ace-johnny avatar Feb 03 '22 07:02 ace-johnny

@ace-johnny, will you please confirm once from p5 team, regarding this. I know it's a huge task to design the website in Dark mode. I will try my best to handle it. Just waiting for approval from the team.

akshatnema avatar Feb 03 '22 08:02 akshatnema