Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added darkmode #672

Merged
merged 8 commits into from
Jan 9, 2024
Merged

Added darkmode #672

merged 8 commits into from
Jan 9, 2024

Conversation

vChavezB
Copy link
Contributor

@vChavezB vChavezB commented Jan 6, 2024

Added an option to have a darkmode in the documentation. The option is based on the implementation from GoogleChromeLabs https://github.com/GoogleChromeLabs/dark-mode-toggle.

At the moment this option is only available if using the W3CStyle.

Motivation

I am more of a night owl and as I am building my ontology at night the white background bothers me. I tried to give a quick shot and it looks good at first glance.

Details

What I changed is

  • css styles from lode to use variable which are then changed dynamically based on a light and dark stylesheet. The colors for the dark mode can be tweaked.
  • Some refactoring in Constants.java.

I tried to make at as less invasive as possible and ended up with a slider that is at the left bottom part of the html:

And this is how it looks in action

To test the changes, the documentation has to be loaded over a server as the dark mode java script from google gives the error

Access to script at 'file:///DOC_SOURCE_PATH/dark-mode-toggle.mjs' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.

@dgarijo
Copy link
Owner

dgarijo commented Jan 6, 2024

Very cool! Thanks. Will have a look this week. I like to space out the releases a bit, but you are adding so many things that it's getting hard not to create a new one ;)

@vChavezB
Copy link
Contributor Author

vChavezB commented Jan 6, 2024

No problem, whenever I am adding features I am glad to make contributions back 😉Here is another update on how it looks with the latest commits

grafik

@dgarijo dgarijo merged commit 29f6a0d into dgarijo:develop Jan 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants