Skip to content

Add supports of light-dark function#899

Merged
stevenjoezhang merged 1 commit intonext-theme:masterfrom
wherewhere:light-dark
Nov 3, 2025
Merged

Add supports of light-dark function#899
stevenjoezhang merged 1 commit intonext-theme:masterfrom
wherewhere:light-dark

Conversation

@wherewhere
Copy link
Contributor

PR Checklist

  • The changes have been tested (for bug fixes / features).
  • Docs in NexT website have been added / updated (for features).

PR Type

  • Bugfix.
  • Feature.
  • Improvement.
  • Code style update (e.g. formatting, linting).
  • Refactoring (no changes to functionality and APIs).
  • Documentation.
  • Translation.
  • Other... Please describe:

What is the new behavior?

Add supports for new CSS feature light-dark:

2025-07-28.164052.mp4

The Code Block does not add light-dark support since the highlight.js and prism does not supports it. The disqusjs ether because the origin style seems not match to the dark one in this project.

@supports (color: light-dark(red, red)) is necessary because post-css will fallback it to weird implementation, which does not support prefers-color-scheme. The lightdark.check_supports can control the @supports block.

How to use?

In NexT _config.yml:

# Light-Dark Mode
lightdark:
  enable: true
  # Add @supports (color: light-dark(red, red)) check
  check_supports: true

@github-actions
Copy link

This pull request contains changes to the configuration file. Please make sure the documentation in NexT website is changed or added.
Please edit relevant source files here: https://github.com/next-theme/theme-next-docs/tree/master/source/docs and create a pull request with the changes here: https://github.com/next-theme/theme-next-docs/pulls

@wherewhere wherewhere changed the title Add supports for light-dark Add supports of light-dark function Jul 29, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19025797671

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 97.451%

Totals Coverage Status
Change from base Build 17457714230: 0.0%
Covered Lines: 400
Relevant Lines: 405

💛 - Coveralls

@stevenjoezhang stevenjoezhang merged commit 0a02719 into next-theme:master Nov 3, 2025
10 checks passed
@wherewhere
Copy link
Contributor Author

uh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants