No video

CSS Dark Mode Toggle Button from scratch in 6 Minutes

  Рет қаралды 77,876

Red Stapler

Red Stapler

2 жыл бұрын

Let's create a dark mode toggle switch/button from scratch in 6 minutes using only CSS!
Download source code here: redstapler.co/...
******** Follow us on ********
Facebook: / theredstapler
Website: redstapler.co/
Twitter: / redstapler_twit
******** Studio Equipment *********
Mic: amzn.to/2Uy7dKw
Audio Interface: amzn.to/3pspAyJ
#css #darkmode #webdesign

Пікірлер: 53
@thedisastro4492
@thedisastro4492 Жыл бұрын
Man you doing perfect things. Your channel is underrated. Im sorry for others who do not know your channel. Keep going.
@N.A.Schilder
@N.A.Schilder Ай бұрын
Amazing video! I have one tip for accessibility, if you don't mind me giving it to you. If you put the visibility to hidden, the checkbox can't always be found by people who use screenreaders or keyboards only. So if you put opacity to 0 and give it a position of absolute, it can always be found by everyone. :)
@SlimBloodworth
@SlimBloodworth 2 жыл бұрын
I ALWAYS enjoy your videos and learn something new each time! Thanks!
@Pupu._
@Pupu._ 2 жыл бұрын
Didn’t know if switch is made from input element. Thanks!
@appleman29
@appleman29 Жыл бұрын
did not work. I did it right but not showing on my site
@thegoldgamer6339
@thegoldgamer6339 5 ай бұрын
maybe you added z-index:-1;
@daanbouma8979
@daanbouma8979 Ай бұрын
Then u didn’t do it right
@k4nh00
@k4nh00 Жыл бұрын
Thank you very much for your help, it was identical to yours. The only comment I can leave is that it is much easier with javascript than with css. Greetings!
@kiaru5131
@kiaru5131 7 ай бұрын
This is perfect. Thanks for sharing!
@Lokesh3152
@Lokesh3152 2 жыл бұрын
Pls don't stop keep making videos
@quielsystems
@quielsystems 2 жыл бұрын
I love it! Keep uploading videos like this!
@EntertainmentTv312
@EntertainmentTv312 Жыл бұрын
Very Awsome Video.Thanks for making this video
@kashishyenare1556
@kashishyenare1556 6 ай бұрын
My inner icon isn't visible I've coded the whole code step by step
@sedigbenomar444
@sedigbenomar444 Ай бұрын
very helpful thank you very much
@mahdinajafi3707
@mahdinajafi3707 7 ай бұрын
my html css: Yours: I hate myself
@user-jm7je3rn9p
@user-jm7je3rn9p 4 ай бұрын
Why do we have a + in: “input:checked +label”? It’s not supposed to be: “input:checked label”?
@matehun5219
@matehun5219 2 жыл бұрын
Make a vid from audio visualizers :D
@FrauleinRose
@FrauleinRose 2 жыл бұрын
i'm here for the moon icon 🌙🙌
@Thirdybirdthe3rd
@Thirdybirdthe3rd 25 күн бұрын
idk too
@amjadnikzad4890
@amjadnikzad4890 2 жыл бұрын
Well done
@sam-nc8zv
@sam-nc8zv 2 жыл бұрын
Superb content... Gald I found your channel.. #subscribed
@aryanmn1569
@aryanmn1569 Жыл бұрын
Now I got why it's called stapler
@Daniblueboy
@Daniblueboy Жыл бұрын
awesome, thanks
@VXTivkot
@VXTivkot 9 ай бұрын
insteAD OF USING ACTIVE YOU SHOULD USE THE hover
@user-jm7je3rn9p
@user-jm7je3rn9p 4 ай бұрын
Awesome
@mohamedyoussef8835
@mohamedyoussef8835 Жыл бұрын
Awesome video ++++++ 😃
@highinspiration9988
@highinspiration9988 2 жыл бұрын
Amazing
@funkeboodha
@funkeboodha Жыл бұрын
Unless your website is only one page, this solution will not save your preference from page to page. It will load whatever state is default in your CSS.
@zedwelly5034
@zedwelly5034 11 ай бұрын
Just the problem for me. Do you know the solution for it to be on a whole site remembered?
@eamontanner6778
@eamontanner6778 9 ай бұрын
You need to create a session for this. I'd recommend creating a database and storing user preferences in there. You can interface with the database using a server-side language like php.
@broli450
@broli450 Жыл бұрын
You should use ids and classes
@VijayKumarYenuganti
@VijayKumarYenuganti 21 күн бұрын
sir how to get svg code
@reynandelizo1480
@reynandelizo1480 Жыл бұрын
I have an issue on sun and moon svg icons outside in my label tag even the position of label is realtive I don`t know the issue.
@Asdpire
@Asdpire 6 ай бұрын
Hi, I don't know if this message reaches you, but the svg:s have a defaulf height which differs from the desired, so just set height to the same as the toggle switch. Hope this helps!
@nexi__cz2061
@nexi__cz2061 3 ай бұрын
@@Asdpire you just saved me 2-3 hours figuring out how to fix that i love you
@user-cy4kq5tc4q
@user-cy4kq5tc4q 2 ай бұрын
Oke gelap dan in the sun 1:31
@cuongie
@cuongie Жыл бұрын
TAYLOR CLASS TSKEOVER
@justinran1693
@justinran1693 Жыл бұрын
Pp
@mirjalol_shamsiddinov
@mirjalol_shamsiddinov Жыл бұрын
just waw
@annie.araujo
@annie.araujo Жыл бұрын
label:active:after is not working
@hikari._.zasureiya1540
@hikari._.zasureiya1540 11 ай бұрын
use label::active instead of laber:active and replace ::active with every :active
@vnxcius
@vnxcius Жыл бұрын
pls make a version using js
@zishanchaudhary221
@zishanchaudhary221 9 ай бұрын
const toggle = document.querySelector("#darkmode-toggle"); let bg = document.body; toggle.addEventListener("change", function () { if (this.checked) { // Toggle button is checked // Perform actions for the checked state bg.style.backgroundColor = "black"; } else { // Toggle button is unchecked // Perform actions for the unchecked state bg.style.backgroundColor = "white"; } }); add these lines in a script tag and thats it.
@alikhodashenas8458
@alikhodashenas8458 23 күн бұрын
Display:none👎 Width:0 Hight:0 👍
@WebDevXpert
@WebDevXpert 3 ай бұрын
Toggle Button In HTML CSS JavaScript |Animated Toggle Button using HTML CSS, JS|Dark and Light Mode : kzfaq.info/get/bejne/jOCalLR-ncXSqXk.html
@mraloush8959
@mraloush8959 Жыл бұрын
this is so overdone lol. u dont know how to code. u can do the exact samt thing in 10 lines css.
@paulhamacher773
@paulhamacher773 Жыл бұрын
What an arrogant comment. Every single line serves its specific purpose. To me you're just bullshitting here unless you prove otherwise.
@mraloush8959
@mraloush8959 Жыл бұрын
@@paulhamacher773 u look like an npc
@paulhamacher773
@paulhamacher773 Жыл бұрын
And now you can't even think of anything better than commenting on my appearance. Pathetic.
@scotfree7702
@scotfree7702 7 ай бұрын
10 lines, post them here then smart arse
How to make a website light/dark toggle with CSS & JS
16:48
Kevin Powell
Рет қаралды 121 М.
Dark mode with TailwindCSS in under 7 minutes
6:58
Built With Code
Рет қаралды 32 М.
Вы чего бл….🤣🤣🙏🏽🙏🏽🙏🏽
00:18
Make Awesome SVG Animations with CSS // 7 Useful Techniques
12:20
Light & Dark mode WITHOUT CSS!
11:42
Kevin Powell
Рет қаралды 106 М.
Use these instead of vh
6:06
Kevin Powell
Рет қаралды 499 М.
Design This ON/OFF Toggle in Figma (Easy)
14:31
Shmelt studios
Рет қаралды 221 М.
Create a Dark Mode Switch with HTML, CSS, JavaScript
6:26
Coding2GO
Рет қаралды 14 М.
CSS Tips And Tricks I Wish I Knew Before
12:12
Lama Dev
Рет қаралды 464 М.
Learn CSS Flexbox in 20 Minutes (Course)
20:37
Coding2GO
Рет қаралды 37 М.
React Dark Mode Toggle/Theme - Complete Guide
12:29
Code Complete
Рет қаралды 24 М.
Light / Dark Mode Toggle In React Tutorial
16:02
PedroTech
Рет қаралды 98 М.
Add Dark Mode to YOUR website with a single line of code
4:51
Bufferhead
Рет қаралды 67 М.