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

Add dark mode, anchor links, utterances support #8

Closed
wants to merge 6 commits into from
Closed

Add dark mode, anchor links, utterances support #8

wants to merge 6 commits into from

Conversation

opeik
Copy link
Contributor

@opeik opeik commented Jan 31, 2022

Hi there,

I've added basic dark mode support as well as some other niceties.

@opeik opeik changed the title Add dark mode, anchor links, inline code block background Add dark mode, anchor links, utterances support Jan 31, 2022
@justint
Copy link
Owner

justint commented Feb 12, 2022

Hey, thanks a bunch for the contributions. I should have some time to take a look in the next couple of weeks.

@justint
Copy link
Owner

justint commented Feb 22, 2022

The dark theming & usage of the CSS custom properties looks great. We should adjust some of the dark theme colors to meet the AA contrast ratio minimums. I can take a pass at this and push another commit for you to review sometime this week.

Utterances is cool, did not know that existed! I'd love to see it in use with Papaya once you've configured it for your instance, if you plan to use it.

One question I have, is why you chose to replace the existing anchor link?

@justint justint self-assigned this Feb 22, 2022
@opeik
Copy link
Contributor Author

opeik commented Feb 25, 2022

We should adjust some of the dark theme colors to meet the AA contrast ratio minimums. I can take a pass at this and push another commit for you to review sometime this week.

Fair point, I'm flat out at the moment so feel free.

One question I have, is why you chose to replace the existing anchor link?

It was a hot minute ago so I'm struggling to recall 😅 There was some issue, I think in regards to the actual anchor becoming visible on hover?

@justint
Copy link
Owner

justint commented Mar 2, 2022

Ah interesting, I've been able to see the current anchor links myself on hover; I'm using Google Chrome. Are you on a different browser?

Will get to the color contrast adjustments soon, when I find time.

@opeik
Copy link
Contributor Author

opeik commented Mar 5, 2022

Are you on a different browser?

Yeah, I use Safari on macOS with Chromium as a backup. That might have been it.

@justint
Copy link
Owner

justint commented Mar 20, 2022

Ok, I've updated the colors to be AA contrast compliant.

However, I've just noticed the current code highlighting is a bit of an eyesore in dark mode:
Capture

It's easy to switch to another code theme that works better with dark mode, but it could be tricky to find one theme that looks good in both light and dark mode. I wonder if it's worth supporting custom code themes for either light or dark mode separately, using Zola's classed syntax highlighting?

.img-dark {
filter: invert(100%) hue-rotate(180deg);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this new img-dark class used for, btw?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

img-dark denotes an image can have the colours inverted in dark mode, I used it mostly for diagrams. I thought I added a parameter to the img shortcode but looks like I forgot 🥲

@opeik
Copy link
Contributor Author

opeik commented Mar 20, 2022

I wonder if it's worth supporting custom code themes for either light or dark mode separately, using Zola's classed syntax highlighting?

This sounds like an ideal solution. I think monokai looked okay in light mode but having seperate light/dark themes would be really nice!

@opeik opeik closed this by deleting the head repository Aug 20, 2022
@justint
Copy link
Owner

justint commented Sep 12, 2022

Hey @opeik, my apologies for ghosting this thread. I think providing dark/light themes for papaya would indeed be really nice, I'm going to re-open this and look into supporting custom code themes next week.

@justint justint reopened this Sep 12, 2022
@justint
Copy link
Owner

justint commented Mar 11, 2023

Hey @opeik, thanks so much again for these contributions. I've finally found the time to resume work on this and was able to get the syntax highlighting working for light/dark mode.

I'm having some weird issues with getting my changes into this PR, so in case you wish to follow along further I've pushed the changes to a new branch and will be merging into main & releasing soon.

@justint justint closed this Mar 11, 2023
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