The current modification implements local storage for the selected theme using an event listener. This ensures that the chosen theme persists even when users leave and return to the site. By default, the website adopts a white theme, but users can change it. The selected theme should remain fixed upon subsequent visits.
For the theme selection, I've utilized default Windows emojis for the Sun and moon icons, enhancing the visual appeal. Notably, I've maintained a visible border on the icon to signify its selectability.
There don't seem to be any performance issues, but there's a minor inconvenience where the page initially loads with a white theme before flickering to the selected theme. This may be more noticeable on slower internet connections, potentially revealing the behind-the-scenes of the website. Whether this is a significant issue is open to discussion.
Key changes can be found in the following files:
config: Sets the default color scheme.
Aux_nav: Adds a new navigation list item to the top-right panel, labeled "Contribute to.."
3 Head.html: Modifies stylesheets and introduces a script for the default "just the docs" theme.js, essentially fixing it to the original code.
Default.html: Incorporates the local script "colorThemeSelection.js," responsible for controlling the theme button, selection, and loading.
ColorThemeSelection.js: Enhances readability and functionality as described.
Issues
The following issues are as listed:
Theme by default is forced to be " light " themed, which means that upon page change it has to be overwritten which introduces flickering to the website when it is changed.
May have issues on very slow internet where the user could see the backsite, but shouldn't be too worried about it performance seem to be valid for the site still.
Fixes
It would be possible to force load stylesheets globally so that the theme changes it for the entire site, but it has underlying issues with the way ruby website is setup and might need internal code changes.
The current modification implements local storage for the selected theme using an event listener. This ensures that the chosen theme persists even when users leave and return to the site. By default, the website adopts a white theme, but users can change it. The selected theme should remain fixed upon subsequent visits.
For the theme selection, I've utilized default Windows emojis for the Sun and moon icons, enhancing the visual appeal. Notably, I've maintained a visible border on the icon to signify its selectability.
There don't seem to be any performance issues, but there's a minor inconvenience where the page initially loads with a white theme before flickering to the selected theme. This may be more noticeable on slower internet connections, potentially revealing the behind-the-scenes of the website. Whether this is a significant issue is open to discussion.
Key changes can be found in the following files:
Issues
The following issues are as listed:
Fixes
It would be possible to force load stylesheets globally so that the theme changes it for the entire site, but it has underlying issues with the way ruby website is setup and might need internal code changes.