Add support for color mode selection by user
Add a switch for user to select a color mode, in addition to the current automatic selection based on browser's color scheme
Light | Dark |
---|---|
By default, the color mode selection is still automatic, i.e. using media query. Each website can be configured to use data attribute for the color mode selection by setting colorModeType: data
config param, then the switch is shown and users can use the switch to select color modes
Automatic / Media query | Manual / Data attribute |
---|---|
This makes use of color mode support added in Bootstrap 5.3 and Hugo's vars
option added in version 0.109.0 to pass values from Hugo to SCSS (Hugo on our server has been updated to 0.110.0).
Edited by Phu Nguyen