Skip to content

Conversation

@laymonage
Copy link
Member

Fixes #1966.

I haven't tried it out locally, so I hope this works ✌️

// CSS from pygments github dark theme
@media (prefers-color-scheme: dark) {
:root {
:root[data-theme="auto"] {
Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, on second thought, it might be better to use :not([data-theme="light"]) instead:

html:not([data-theme="light"]) {

The end result should be the same, but it's more consistent with the above existing code.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've changed it to use the above approach.

@laymonage laymonage force-pushed the fix-syntax-highlight-theme branch from 130d5ac to b0726a1 Compare April 26, 2025 09:43
Copy link
Member

@bmispelon bmispelon left a comment

Choose a reason for hiding this comment

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

Before:

Screenshot 2025-04-28 at 21-22-37 Models Django documentation Django

After:

Screenshot 2025-04-28 at 21-24-07 Models Django documentation Django

The bug appears to be fixed with the proposed changes, and they look reasonable. Nice work, thanks! 🎸

@bmispelon bmispelon merged commit 341d954 into django:main Apr 28, 2025
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.

Code snippets use wrong palette in explicit light mode with dark system preference

2 participants