We just downloaded Metronic 8.1.1 and are trying to set dark mode using the setMode API method mentioned in
https://preview.keenthemes.com/metronic8/demo1/documentation/getting-started/dark-mode.html
As seen below:
However I'm getting the following:
Uncaught TypeError: Cannot read properties of undefined (reading 'setAttribute')
at o (scripts.bundle.js:7:31521)
at Object.setMode (scripts.bundle.js:7:32850)
at index.html:16242:22
How can I set the mode based on the API method.
The reason I'm asking this is because we are not planning to use the built in switching method, we read user settings from the DB
Hi,
This seems a bug when the theme switch menu is completely removed.
We will fix it in a future update and provide you hot fix soon.
We are releasing a new update Metronic v8.1.2 and we enabled user preference theme mode support. All you need is to set the theme mode from DB into the root HTML tag as explained here: https://preview.keenthemes.com/html/metronic/docs/getting-started/dark-mode
Please expect the new update shortly(its submitted and will be released once approved by Themeforest in a few hours) and download it from Metronic Downloads page.
Regards.