Build An Easy Light/Dark Mode Toggle With CSS & JavaScript

  Рет қаралды 26,002

Slaying The Dragon

Slaying The Dragon

Күн бұрын

Пікірлер: 108
@slayingthedragon
@slayingthedragon Жыл бұрын
Just to let everyone know, at 13:49 I define an arrow function but I forget to assign it in a variable. Code still works though but, you should probably add the const before handleToggleTheme. I'm a silly goose.
@avijitroyankan305
@avijitroyankan305 Жыл бұрын
i was surprised at that time 😆
@shreyanshrathore6782
@shreyanshrathore6782 Жыл бұрын
Loved the way, how you explained short circuiting....
@rupiik
@rupiik Жыл бұрын
You are AMAZING at explaining things! Showing examples, how one element is connected to another and giving most practical information as simply as it need to be.
@Vaannnard
@Vaannnard Жыл бұрын
Amazing videos! I've binge watched through your channel today and I'm happy I found it. It explains css units, flexbox, grids, positioning and very useful general knowledge really well!
@valentino8195
@valentino8195 Жыл бұрын
Awesome and easy to understand video! Thank you very much. Cant wait to implement this to my own website. Keep up the great work. Greetings from switzerland
@andreirusen8410
@andreirusen8410 Жыл бұрын
Really good video! Very explicit and informative!
@NYDEV0
@NYDEV0 Жыл бұрын
You deserve millons of subs
@slayingthedragon
@slayingthedragon Жыл бұрын
Thank you 😊❤
@royalgreenchannel574
@royalgreenchannel574 Жыл бұрын
please upload the videos on regular basis. at least weekly once . your videos are something special. make a videos on full stack development.
@itsmo_01
@itsmo_01 Жыл бұрын
Next time do a calculator with js pls !!
@mujtabakhan4521
@mujtabakhan4521 Жыл бұрын
you are my favouritteeeeeeeeeeeeeeeeeeeeee
@Zynix-
@Zynix- Жыл бұрын
You are so good at explaining things, your tutorials are so underrated 🔥 your tutorials deserve attention..
@slayingthedragon
@slayingthedragon Жыл бұрын
I appreciate that!
@DannyH77
@DannyH77 11 ай бұрын
@@slayingthedragon when will JavaScript course be ready? i love the way you teach!!
@slayingthedragon
@slayingthedragon 11 ай бұрын
@@DannyH77 Thank you, I just released the CSS course and courses take time to complete, so we're many months away from the JS course unfortunately, I'm doing my best though and I appreciate the interest 🙂
@DannyH77
@DannyH77 11 ай бұрын
@@slayingthedragon OK ,Thank you
@DannyH77
@DannyH77 11 ай бұрын
@@slayingthedragon I'm still struggling with grid, so I'll just keep practicing with that, and css animation until you put out JavaScript course
@methodboss6719
@methodboss6719 Жыл бұрын
Who wants a full course from this guy The way he teaches it's so understandable And excuse me for my English because I am not good at my English
@Sonya_Makepeace
@Sonya_Makepeace Жыл бұрын
Your English is good, don't worry.
@SaladHood
@SaladHood Жыл бұрын
I hope you produce more content mate. Your videos are so short and concise and I learn a lot from them. Very easy to understand and follow along.
@Palisis
@Palisis 10 ай бұрын
Those extra 3 mins at the end are golden
@antoniotopic6196
@antoniotopic6196 Жыл бұрын
Post more tutorials about JS. You are teaching better than Ask Lixi (and she is better than others!)
@bilaltoor123
@bilaltoor123 Жыл бұрын
Your are very helpful for me friend lovee from Pakistan ❤️❤️❤️
@vilassa
@vilassa Жыл бұрын
Hey man, are you still alive? I just discovered your channel, and you rock. Give us more tutorials, for sure with the correct affiliate programs you can make some good money, and it will be useful for us. Keep rocking, cheers|
@TheWabbbit
@TheWabbbit Жыл бұрын
To implement darkmode without JS, @media (prefers-color-scheme: dark) in CSS. do the work?
@kudrah
@kudrah 6 ай бұрын
Best Teacher. Please make more JavaScript Videos as well. You're enhancing my programmer thinking process.
@fexrihesenov8045
@fexrihesenov8045 Жыл бұрын
Where are you ? Please come back ) We need more more new tricks, 3d and moreover which contain js projects
@abbdd-zg7zy
@abbdd-zg7zy Жыл бұрын
thanks from syria and wish you Continue 🌹❤️
@wiz8058
@wiz8058 Жыл бұрын
please am new to react and am having issues. Can you do a video on react? Touching on basic and one videos to create a single page website.
@molostv2786
@molostv2786 Жыл бұрын
Young (14y/o) developer and i have to say, your videos are one of the most helpful ways i get new information on coding! much love from Kosovo
@slayingthedragon
@slayingthedragon Жыл бұрын
That's so awesomeee! I hope you keep at it - I'm sure you'll go far !
@AkibAhmadGaming
@AkibAhmadGaming 4 ай бұрын
@molostv2786 same here
@jimi2004
@jimi2004 Жыл бұрын
I had never felt so comfortable learning with KZbin videos until I came across your channel, I hope you can upload more content like this, because you really make very good content, I hope you can make a video about sidenav and how to align it correctly with Main in the center and the articles on the right side. Greetings from Mexico 🇲🇽
@hamzaashraf1776
@hamzaashraf1776 Жыл бұрын
Your videos are the best on youtube about basic frontend. I need to understand the concept of :before and :after with the content:"" seems like a challenging video.
@shahnoormughal6553
@shahnoormughal6553 Жыл бұрын
You are doing very great. Please more vedios like thesee❤
@defichronicles
@defichronicles Жыл бұрын
Amazing!
@Amar-b9j4c
@Amar-b9j4c 7 ай бұрын
bro ure the best
@methodboss6719
@methodboss6719 Жыл бұрын
Create a full course on CSS and JavaScript
@slayingthedragon
@slayingthedragon Жыл бұрын
I'm working on a CSS course right now! And after I'll release a free JS course on KZbin as a playlist :p
@shubhamshukla7778
@shubhamshukla7778 Жыл бұрын
Bro please make video on Java script full
@shahnoormughal6553
@shahnoormughal6553 Жыл бұрын
Make a complete javascrit course plzz❤
@malekgharyani2339
@malekgharyani2339 Жыл бұрын
u are too good broo keep going
@TheChiaralyn
@TheChiaralyn Жыл бұрын
Thank you so much, your video are amazing! Hugs from Italy 😊
@ShawnRitch
@ShawnRitch Жыл бұрын
You wouldn't happen to know any DeMarco's there in Italy, would you?
@bowbowbow22
@bowbowbow22 5 ай бұрын
You're an exquisite instructor.
@dreamcatchermarketing4783
@dreamcatchermarketing4783 Жыл бұрын
Thanks
@mohamedibrahemsaad573
@mohamedibrahemsaad573 Жыл бұрын
please come back We miss your channel
@HexFireGaming1
@HexFireGaming1 Жыл бұрын
Bro upload new video related to css
@UniversaL_
@UniversaL_ Жыл бұрын
Can u pls created a video on javascript
@zancrow_gaming
@zancrow_gaming Жыл бұрын
Bro I had issues understanding the guard operators coz I just started javascript. But I understand almost everything I see here. Well explained💯
@reromsp
@reromsp Жыл бұрын
Expecting more js videos
@JulianStark
@JulianStark 11 ай бұрын
Thanks for the great video! One question but I might be wrong: I think you put the js to the footer or end of body. Let’s imagine this is a big site with lots of content in the body. So if I load a new page and I’m already in dark mode I guess the colors will only switch to dark after the page has loaded and the js has been started. There will be some kind of flash from light to dark. Right? Would it be better, to put the code to the head?
@slayingthedragon
@slayingthedragon 11 ай бұрын
Hey, I found this stackoverflow with a similar question to yours, the answer is pretty good! stackoverflow.com/questions/71799083/white-flash-on-dark-mode-on-refreshing-page
@JulianStark
@JulianStark 11 ай бұрын
@@slayingthedragon thank you! so I guess the JS should be in the head with no defer in it
@yoanmitrev
@yoanmitrev Жыл бұрын
Hey man, I have watched all of your videos and I have to say nobody has ever taught me that much about coding. Maybe in the future you can make a video about drop-down menus and how to make them. I'm sure this will be of great use. Thanks!
@slayingthedragon
@slayingthedragon Жыл бұрын
Great suggestion thanks you ☺️ !
@ZockaRocka
@ZockaRocka Ай бұрын
I really like your code 😊 However i think it would have been even better to use the returned value of the toggle method from the DOMTokenList for the if condition in the handler
@mountacer4159
@mountacer4159 Жыл бұрын
You are amazing ❤ love the way you explaine 😊
@kyrilevangelista4056
@kyrilevangelista4056 10 ай бұрын
Very informative and helpful, thank you so much! Subscribed as well
@jaydeepgill218
@jaydeepgill218 Жыл бұрын
Your flex, grid and other css videos are too great.... please also make some videos on JavaScript ...i am really finding it hard....
@slayingthedragon
@slayingthedragon Жыл бұрын
I will, I'm just finishing up my CSS course and I'll come back with weekly content on KZbin !
@KeyStroke_IT
@KeyStroke_IT Жыл бұрын
Love your work bro. Well paced and detailed videos. I'm watching from Nigeria. ✌🏾
@alimansimov1929
@alimansimov1929 6 ай бұрын
Truly excellent, when will your JS course come? I saw it on your website.
@slayingthedragon
@slayingthedragon 5 ай бұрын
Some time during the summer
@alimansimov1929
@alimansimov1929 5 ай бұрын
@@slayingthedragon the method you taught in this video was excellent I have never ever seen something like. I hope the method will be same.
@johndoe8091
@johndoe8091 4 ай бұрын
Amazing videos dude, do you have a video on how to decouple scroll transitions from theme switching?
@jeremiah869
@jeremiah869 Жыл бұрын
Literally the best web-dev content in the game, what an amazing channel
@Onik_the_computer_geek
@Onik_the_computer_geek Жыл бұрын
Love ur content bro
@bonezonechannel
@bonezonechannel 10 ай бұрын
awesome! easy to follow, and allowed me to easily customize more to my wants. will be trying this method with another theme idea other than colors.
@joelrhine
@joelrhine 5 ай бұрын
The "floating there in nothingness" made me laugh more than it should have.
@raunak_saha
@raunak_saha Жыл бұрын
" We can do better"
@Avarn388
@Avarn388 Жыл бұрын
Excellent job. I really loved how you explained short circuiting. It’s such a powerful concept of JavaScript and when leveraged here, it makes a worlds difference.
@nghialenguyenduy8386
@nghialenguyenduy8386 Жыл бұрын
good job man 🎉🎉
@amdjed_mijoukh
@amdjed_mijoukh Жыл бұрын
can you talk about images and background properties and when to use them.ty and gj your content is very good and not too long
@ericaimhigh
@ericaimhigh Жыл бұрын
I'm here again. Your explanation is top notch
@thatoneshortkidjordy2144
@thatoneshortkidjordy2144 Жыл бұрын
Dddamn, how you good at css and brawl 😔
@slayingthedragon
@slayingthedragon Жыл бұрын
Haha this one is actually JavaScript but thank you ☺️❤️
@parthshandilyaiitr
@parthshandilyaiitr Жыл бұрын
You need to start a course or something
@slayingthedragon
@slayingthedragon Жыл бұрын
❤️❤️❤️
@ronaldawudi-ackerman905
@ronaldawudi-ackerman905 11 ай бұрын
Thanks
@srshah
@srshah Жыл бұрын
Hey buddy do you use these concepts in production apps as well?? Or do you use any UI libraries??
@slayingthedragon
@slayingthedragon Жыл бұрын
I use React and NextJS for anything production. However if I were tasked to do this in vanilla JS for production, I would do it exactly like I did it on the video.
@srshah
@srshah Жыл бұрын
@@slayingthedragon Seeing from your portfolio video I'm guessing you use tailwind with Next JS🤔, I use the same. Can you advise me on usage of libraries like chakra in NextJS apps or should I stick with css/tailwind.
@slayingthedragon
@slayingthedragon Жыл бұрын
@@srshah I can't speak for Chakra I've never used it. For styling I either use TailwindCSS or CSS Modules alongside NextJS. TailwindCSS is the only styling library I used, otherwise I really like normal CSS
@samplechannel2312
@samplechannel2312 Жыл бұрын
Yes... really great explanation...❤ We need entire real time project ( js or react) with same level of explanation
@Garvitjain-ru4ci
@Garvitjain-ru4ci Жыл бұрын
I am totally counting on you. Also expecting more content like this.
@ifunanyablessing3411
@ifunanyablessing3411 Жыл бұрын
nice video, I love ur teaching style please can u make a complete css lesson
@andei9743
@andei9743 Жыл бұрын
Beautiful explanation
@sayanghosh6996
@sayanghosh6996 Жыл бұрын
Good content as always, also liked the playfullness on this one!
@slayingthedragon
@slayingthedragon Жыл бұрын
Thank you ❤️❤️
@avijitroyankan305
@avijitroyankan305 Жыл бұрын
💯💯
@alqudesalislami
@alqudesalislami Жыл бұрын
you are really professional, could I ask how many year do I need to become like you, I am still beginner?
@slayingthedragon
@slayingthedragon Жыл бұрын
Heyy, everyones journey is going to be different, you just need to do your best and not give up ❤
@tauromusic96
@tauromusic96 11 ай бұрын
Hey good video! have a question, when i refresh the page still in dark mode it didn't change in sun but remain moon so i have to double click on it to return in light mode, how can i fix that? Thanks
@tauromusic96
@tauromusic96 11 ай бұрын
I used font awesome icon so they change on click
@kilimanjaro8075
@kilimanjaro8075 Жыл бұрын
Pls java script tutorial series 🥲🤌
@CornSensei
@CornSensei Жыл бұрын
Amazing Video! Very clear and works great! 💯 Just wondering if you knew how to make it remember your icons for dark/light modes on refresh? For example I have a moon for dark mode and a sun for light. Thanks in advance 😄
@sylojos
@sylojos Жыл бұрын
Hello I have a question regarding the making the code more readable, where do I place the function? Place it under handlers comment or place it at the very top of the code or at the very bottom of the code? function abc() { alert("Hi"); }
@slayingthedragon
@slayingthedragon Жыл бұрын
Placing it under the handler comment makes it the most readable. You don't want your functions at the top, it makes more sense to have your selectors at the top. I didn't invent this pattern, JavaScript frameworks like React use a very similar structure and the way I structured it in the video is most recognizable for other developers.
@sylojos
@sylojos Жыл бұрын
@@slayingthedragon Thank you! Love your videos. I hope you consider to upload framework tutorial in the future.
@nirajpathak99
@nirajpathak99 Жыл бұрын
Ternary operators can be used to shorten the code.
@slayingthedragon
@slayingthedragon Жыл бұрын
Did you watch the entire video ?
@nirajpathak99
@nirajpathak99 Жыл бұрын
Yeah 👍 I know what you mean
@slayingthedragon
@slayingthedragon Жыл бұрын
Much love ❤️
@nirajpathak99
@nirajpathak99 Жыл бұрын
@@slayingthedragon Hey I'm working on a personal project. Need to use REM as breakpoints. But it has issues so JS implementation will work I guess.
@Gomnojedac
@Gomnojedac 8 ай бұрын
What is this theme in vs code? Thanks
@slayingthedragon
@slayingthedragon 8 ай бұрын
one dark pro
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 961 М.
Flexbox or grid - How to decide?
18:51
Kevin Powell
Рет қаралды 729 М.
Worst flight ever
00:55
Adam W
Рет қаралды 27 МЛН
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4,9 МЛН
HAH Chaos in the Bathroom 🚽✨ Smart Tools for the Throne 😜
00:49
123 GO! Kevin
Рет қаралды 16 МЛН
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 68 МЛН
A CSS Unit Deep Dive - Learn CSS Units & When To Use Them
15:13
Slaying The Dragon
Рет қаралды 89 М.
Learn CSS BOX MODEL - With Real World Examples
17:45
Slaying The Dragon
Рет қаралды 125 М.
Learn CSS Subgrid in 14 minutes
14:19
Slaying The Dragon
Рет қаралды 76 М.
You Don't Need JavaScript For This - CSS ONLY Infinite Scroll
23:35
Slaying The Dragon
Рет қаралды 118 М.
How to create a Circular Progress Bar in less than 10 minutes
9:33
How to make a website light/dark toggle with CSS & JS
16:48
Kevin Powell
Рет қаралды 122 М.
Award Winning Animation With Only 20 Lines Of CSS?
6:59
Hyperplexed
Рет қаралды 1,8 МЛН
You’re doing dark mode wrong!
7:54
Coding in Public
Рет қаралды 51 М.
Light & Dark mode WITHOUT CSS!
11:42
Kevin Powell
Рет қаралды 106 М.
Full Dark Mode with only 1 CSS PROPERTY?!
12:49
DesignCourse
Рет қаралды 157 М.
Worst flight ever
00:55
Adam W
Рет қаралды 27 МЛН