Hi !
This week, I've been working with open source static site generator SSG called Docusaurus build with React.
Setting up Docusaurus project wasn't hard.
Feature
Docusaurus has dark and light modes for their website. It allows users to adjust website look based on their preferences, which gives user better UX.
I decided to take this feature from them and implement it on my static site generator.
Implementation
Since, docusaurus is an open-sourse project, then I just copied the icons from them for dark/light modes :)
After that, I added some classes for dark modes and wrote functionality in vanilla JS.
Last but not least
Another important thing I added to my SSG is that when user refreshes the page, he might lose the preferred mode. Now the selected mode is saved to localstorage.
Overall
There are so many great features to take from Docusaurus and in the future I will add more!
Software is never done
Top comments (0)