Visitar URL original
[feature-Request] Dark mode make website more attractive · Issue #179 · GitbookIO/javascript · GitHub
Skip to content

[feature-Request] Dark mode make website more attractive  #179

Open

Description

@mohitmk007

add dark mode functionality

Activity

  1. Pratik-09pp commented on Oct 1, 2023

    @Pratik-09pp

    @mohitmk007 I would like to work on this issue? Can you assign it to me?

  2. Tsiangana commented on Jan 3, 2024

    @Tsiangana

    The code:

    let button1 = document.getElementbyId("button1");
    let button2 = document.getElementbyId("button2");

    button1.addEventListener('click', ()=>{
    body.style.background= "#000";
    button1.style.display = "none";
    button2.style.display = "inline";
    })
    button2.addEventListener('click', ()=>{
    body.style.background= "#fff";
    button2.style.display = "none";
    button1.style.display = "inline";
    })

    **This is the simplest way to create dark mode, it's so simple that any beginner can do it.

    creates two buttons in the same place, one will start with the value none, while the other will have the value iniline, when one is activated it changes the color of the body and hides itself while the other appears and vice versa.

    There are several ways to do dak mode with js and other more professional ways, but this is the simplest and fastest way to do it**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions