Metronic supports full Dark Mode that you can preview here and easiliy setup following the below instructions.
--dark-mode
flag in
theme/tools/
folder to generate the Dark Mode of CSS files.
gulp --dark-mode --demo1
npm run build --dark-mode --demo1
style.dark.bundle.css
and
plugins.dark.bundle.css
are generated in assets folder:
<!--begin::Global Stylesheets Bundle(used by all pages)-->
<link href="assets/plugins/global/plugins.dark.bundle.css" rel="stylesheet" type="text/css" />
<link href="assets/css/style.dark.bundle.css" rel="stylesheet" type="text/css" />
<!--end::Global Stylesheets Bundle-->
dark-mode
class name to the
<body>
tag. Keep other
body
class names.
<body class="dark-mode ...">
<!-- HTML content -->
</body>
KTApp.setThemeMode(mode String, callback Function)
to set the theme mode dynamically without refreshing the page:
KTApp.setThemeMode("dark", function() {
console.log("changed to dark mode");
}); // set dark mode
KTApp.setThemeMode("light", function() {
console.log("changed to light mode");
}); // set light mode
-dark
prefix to the file name:
<img src="assets/media/illustrations/sketchy-1/1.png"/>
<img src="assets/media/illustrations/sketchy-1/1-dark.png"/>