creativetimofficial / argon-dashboard

Argon - Dashboard for Bootstrap 5 by Creative Tim
https://www.creative-tim.com/product/argon-dashboard
MIT License
674 stars 1.26k forks source link

[Feature Request] Light / DARK #75

Open jayantsr opened 2 years ago

jayantsr commented 2 years ago

What is your enhancement?

How to make the theme default to dark?

rarestoma commented 2 years ago

Hi @jayantsr,

Thank you for working with our products.

To make the theme dark you have to add dark-version class to the body tag.

Thank you, Rares

jayantsr commented 2 years ago

Thank you very much for the support

On Mon, 21 Feb 2022 at 3:04 PM, Toma Rares @.***> wrote:

Hi @jayantsr https://github.com/jayantsr,

Thank you for working with our products.

To make the theme dark you have to add dark-version class to the body tag.

Thank you, Rares

— Reply to this email directly, view it on GitHub https://github.com/creativetimofficial/argon-dashboard/issues/75#issuecomment-1046658160, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCLQQGBXQKH3NXSM42XPS3U4IBJFANCNFSM5OZ3WPRQ . You are receiving this because you were mentioned.Message ID: @.***>

vladutt commented 1 year ago

a small function that switch modes. with jquery :)

function switchMode() {
    let body = $('body');
    let leftNavbar = $('aside');

    if (body.hasClass('dark-version')) {
        body.removeClass('dark-version')
    } else {
        body.addClass('dark-version');
    }

    if (leftNavbar.hasClass('bg-white')) {
        leftNavbar.removeClass('bg-white')
    } else {
        leftNavbar.addClass('bg-white');
    }
};