HTML CSS & JAVASCRIPT, YouTube

How to create a light to dark mode

How to create a light to dark mode for HTML CSS & Vanilla Javascript 2021

Coding BD given here How to create a light to dark mode for HTML CSS & Vanilla Javascript 2021 . Our creative light to dark mode styles are the most important part Of dark mode switch css , html and javascript. We created an expanded css3 effects animation tutorial. We have given more importance to the dark mode html. We have used javascript effects because they need Highly effects. Thank you so much.

😍😍 If You like this video Please like, share and subscribe This video.😍😍

😍😍 Check Others Programming Video👇

➡️ creative button hover effects: https://www.youtube.com/watch?v=3FbyiuhhhTI

➡️ How to Download Source code in Coding BD: https://www.youtube.com/watch?v=WXAZ-BScKBE&t=3s

➡️Responsive website html css javascript | part( 1 ): https://www.youtube.com/watch?v=g0ART…

➡️ Responsive Services Section: https://www.youtube.com/watch?v=wvLky…

➡️ CSS Clip Path Hover Circle Hover Effects: https://www.youtube.com/watch?v=cRSgo…

➡️ CSS Responsive CARD Hover Effects & Adding Stroke to Text | Html5 CSS3 2021: https://www.youtube.com/watch?v=QVMJ5…

➡️ Neon Light Button Animation Effects on Hover | CSS Snake Border: https://www.youtube.com/watch?v=GtVSF…

➡️ Responsive Box Model Web Design Using CSS Flexbox: https://www.youtube.com/watch?v=03RuV…

➡️ Digital Clock with Animated Progress-bar | HTML CSS & Vanilla Javascript: https://www.youtube.com/watch?v=6A6Hp…

➡️ How to create a light to dark mode for HTML CSS & Vanilla Javascript 2021: https://www.youtube.com/watch?v=43FbR…

➡️Scroll top button : https://www.youtube.com/watch?v=9fDEJ…

➡️ Animated eid mubarak 2021 using Html CSS & Javascript: https://www.youtube.com/watch?v=60H2g…

Here is all Source code ( How to create a light to dark mode ). You can follow this steps:

  1. Create 1 folder
  2. create 1 HTML file: index.html
  3. create 1 CSS file: style.css
  4. copy HTML code and pest HTML file, copy CSS code and past CSS file
  5. Now give a smile and jump out loud. 😍😍
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Light To Dark</title>
    <!--======================== Bootstrap css Link  =======================-->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
        integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    <!--======================== Font Awesome Link =======================-->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

    <link rel="stylesheet" href="./style.css">
</head>
<body>
    <div class="view_mode" data-mode="light" onclick="changedMode(this)">
        <i class="fa fa-moon-o" aria-hidden="true"></i>
    </div>
    <div class="container">
        <div class="section_title text-center">
            <h1>Main Content</h1>
        </div>
        <div class="row">
            <div class="col12 col-md-6">
                <div class="d-flex align-items-center boxShadow p-3">
                    <div class="icon-box">
                        <i class="fa fa-tree"></i>
                    </div>
                    <div class="content-box">
                        <h2>Inovation</h2>
                        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsa illum placeat expedita eligendi magnam aspernatur laborum exercitationem voluptatibus reprehenderit dolore.</p>
                    </div>
                </div>
            </div>
            <div class="col12 col-md-6">
                <div class="d-flex align-items-center boxShadow p-3">
                    <div class="icon-box">
                        <i class="fa fa-apple"></i>
                    </div>
                    <div class="content-box">
                        <h2>Iphone</h2>
                        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsa illum placeat expedita eligendi magnam aspernatur laborum exercitationem voluptatibus reprehenderit dolore.</p>
                    </div>
                </div>
            </div>
            <div class="col12 col-md-6">
                <div class="d-flex align-items-center boxShadow p-3">
                    <div class="icon-box">
                        <i class="fa fa-android"></i>
                    </div>
                    <div class="content-box">
                        <h2>Android</h2>
                        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsa illum placeat expedita eligendi magnam aspernatur laborum exercitationem voluptatibus reprehenderit dolore.</p>
                    </div>
                </div>
            </div>
            <div class="col12 col-md-6">
                <div class="d-flex align-items-center boxShadow p-3">
                    <div class="icon-box">
                        <i class="fa fa-flash"></i>
                    </div>
                    <div class="content-box">
                        <h2>Flask</h2>
                        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsa illum placeat expedita eligendi magnam aspernatur laborum exercitationem voluptatibus reprehenderit dolore.</p>
                    </div>
                </div>
            </div>
            <div class="col12 col-md-6">
                <div class="d-flex align-items-center boxShadow p-3">
                    <div class="icon-box">
                        <i class="fa fa-money"></i>
                    </div>
                    <div class="content-box">
                        <h2>Money</h2>
                        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsa illum placeat expedita eligendi magnam aspernatur laborum exercitationem voluptatibus reprehenderit dolore.</p>
                    </div>
                </div>
            </div>
            <div class="col12 col-md-6">
                <div class="d-flex align-items-center boxShadow p-3">
                    <div class="icon-box">
                        <i class="fa fa-book"></i>
                    </div>
                    <div class="content-box">
                        <h2>Book</h2>
                        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsa illum placeat expedita eligendi magnam aspernatur laborum exercitationem voluptatibus reprehenderit dolore.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <script src="./app.js"></script>
</body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Poppins:[email protected];200;300;400;500;600&display=swap');
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
    --body--background-color: #F5F7FD;
    --icon-background: #000;
    --text-color: #000;
    --box-shadow: rgb(36 36 36 / 6%);
    --box-background: #fff;
    --border: none;
    transition: .5s;
}
[data-theme=dark] {
    --body--background-color: #000;
    --icon-background: #fff;
    --text-color: #fff;
    --box-background: #000;
}

body{
    background: var( --body--background-color);
    font-family: 'Poppins' sans-serif;
    transition: .5s;
    -webkit-transition: .5s;
    -moz-transition: .5s;
    -ms-transition: .5s;
    -o-transition: .5s;
}

.section_title{
    padding: 30px 0;
    text-transform: uppercase;
    color: var(--text-color);
    transition: .5s;
}

.icon-box{
    min-width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #5DC511;
    border-radius: 50%;
    transition: .5s;
    -webkit-border-radius: 50%;
    background: var(--icon-background);
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
}
.icon-box .fa{
    font-size: 22px;
    font-weight: bold;
}

.content-box{
    padding: 0 20px;
    padding-top: 10px;
    color: var(--text-color);
    transition: .5s;
}

.view_mode{
    position: fixed;
    right: 4rem;
    bottom: 4rem;
    width: 70px;
    height: 70px;
    z-index: 11;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #5DC511;
    border-radius: 50%;
    background: var(--icon-background);
    transition: .5s;
    cursor: pointer;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
}
.boxShadow{
    box-shadow: 0 0.2rem 2.8rem var(--box-shadow);
    transition: .5s;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid rgba(223, 223, 223, 0.1);
    background: var(--box-background);
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    -ms-border-radius: 6px;
    -o-border-radius: 6px;
}
const changedMode = (theme) => {
    if(theme.dataset.mode == 'light'){
        document.documentElement.setAttribute("data-theme", "dark");
        theme.dataset.mode = "dark";
    }else{
        document.documentElement.setAttribute("data-theme", "light");
        theme.dataset.mode = "light";
    }
}

Don’t Forget to Follow me on all Social Network

YouTube: https://www.youtube.com/channel/UCw9etYfx-25oKB_qt1fFNWw

Facebook Page: https://www.facebook.com/codingbd2021

LinkedIn: https://www.linkedin.com/in/sajjat-ho… 

GitHub: https://github.com/cgsaleh8383

You can see CSS Glassmorphism User Card

Related Posts

Leave a Reply

Your email address will not be published.