This is a simple script and stylesheet to enable automatic theme switching for Stoplight Elements based on the user's OS theme preference (light or dark mode). It listens for changes in the user's theme preference and updates the Stoplight Elements theme accordingly.
This project contains a modified stylesheet of a Nord theme for Prism.js, which is used by Stoplight Elements for syntax highlighting. It was adapted to work with the theme switching functionality and to ensure that the styles are applied correctly when the theme changes.
To use this theme mode switching functionality with your Stoplight Elements, simply include the following lines in the <head> section of your HTML document, after including the Stoplight Elements script and stylesheet:
<link rel="stylesheet" href="https://cdn.statically.io/gh/sirkadirov/stoplight-elements-auto-theme@main/styles.css?v=2">
<script src="https://cdn.statically.io/gh/sirkadirov/stoplight-elements-auto-theme@main/script.js?v=2"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sirkadirov/stoplight-elements-auto-theme@main/styles.css">
<script src="https://cdn.jsdelivr.net/gh/sirkadirov/stoplight-elements-auto-theme@main/script.js"></script>- The original Nord theme was created by Arctic Ice Studio & Sven Greb, and enhanced by contributors.
- The theme was adapted for Prism.js by Zane Hitchcoxc and Gabriel Ramos, their work can be found in the official Prism.js themes repository on GitHub. Their work was licensed under the MIT License.
- The theme was further modified and adapted for usage with Stoplight Elements by Yurii Kadirov, an author of Unisched, a mobile application that acts as a central hub for academic life, focusing on providing a smooth experience for students and staff of Ukrainian universities, and is licensed under the MIT License.
- Also, the theme switching script was created by Yurii Kadirov, and is licensed under the MIT License.
This project is licensed under the MIT License. See the LICENSE.md file for details.
