creativetimofficial / ct-material-dashboard-pro

Material Dashboard Pro - Premium Bootstrap 5 Admin
https://demos.creative-tim.com/material-dashboard-pro/pages/dashboards/analytics
116 stars 28 forks source link

[Feature Request] factor out darkMode( el ) #325

Open liemteksun opened 2 years ago

liemteksun commented 2 years ago

What is your enhancement?

Can you factor out function darkMode(el)?

I don't use "Material UI Configurator" side bar - I use my own page to let the user configures the color & dark mode

I suggest adding a function darkMode( boolean ), which will be called by darkMode(el) Essentially, darkMode(el) will be something like

function darkMode(el)
{
   if ( !el.getAttribute("checked") )
   {
      darkMode( true );
      el.setAttribute("checked", "true");
   }
   else
   {
      darkMode( false );
      el.removeAttribute("checked");
   }
}

thanks

rarestoma commented 2 years ago

Hi @liemteksun,

Thank you for working with our products.

I just added this requirement to be discussed for the next update.

Best regards, Rares