No video

Dark mode with a media query!

  Рет қаралды 31,458

Kevin Powell

Kevin Powell

Күн бұрын

Пікірлер: 95
@Anth-ony
@Anth-ony 4 жыл бұрын
Pretty neat. I'd also be interested in seeing the JS toggle.
@KyleMerl
@KyleMerl 4 жыл бұрын
The JS toggle would be a worthwhile tutorial. I could see using the same concepts from that for other accessibility things, like having buttons that change the size of text on the screen and stuff like that.
@jlogo80
@jlogo80 4 жыл бұрын
Please Kevin I'd love your video with a js switch!!
@sahilsindhu6290
@sahilsindhu6290 4 жыл бұрын
Hi kevin, it's awesome. Can u please make video on JS toggle button.
@lipun_panda
@lipun_panda 4 жыл бұрын
I would love the JS toggle switch for Dark Theme
@mohammedzaid5989
@mohammedzaid5989 4 жыл бұрын
same
@alexisortizojeda809
@alexisortizojeda809 4 жыл бұрын
He uploaded a video today where he uses localStorage and a toggle to switch between modes!
@rowinmol2164
@rowinmol2164 4 жыл бұрын
Awesome, definitely interested in a JS version 🔥
@AlexTechie
@AlexTechie 4 жыл бұрын
You're really creative; the first site I've ever seen use something other than white + dark gray for light and dark mode. Great video, Kevin!
@arshad.mp4
@arshad.mp4 4 жыл бұрын
Today, I checked my mail and I found your mail regarding this video and when I clicked on the link, it's totally worth of. Thanks Kevin
@GGdevelopment
@GGdevelopment 4 жыл бұрын
LOVING YOUR STUFF!!!!
@birsingh5388
@birsingh5388 4 жыл бұрын
Yes, please add toggle with JS to change the colors
@eokwukwe
@eokwukwe 4 жыл бұрын
Js toggle will make sense also.
@VerySadBatman
@VerySadBatman 4 жыл бұрын
Thank you for this! It's a game changer for native and progressive web applications with very minimal code. You're awesome!
@fuse98
@fuse98 4 жыл бұрын
Kevin, just wanted to post on your most recent video to increase the chance that you'll see it. I've been watching a lot of your videos as I stumbled upon your channel from a CSS Dos and Donts search that I did and I'm really enjoying your entire approach at teaching as well as your fluidity in your videos. Keep doing what you do, I personally appreciate the time and effort. Cheers
@KevinPowell
@KevinPowell 4 жыл бұрын
Really glad that you're enjoying my content! I try to keep up on all comments, so feel free to post on any video (it's easier for me to see comments on old videos than replies to comments on new videos)
@rashikkarmacharya8023
@rashikkarmacharya8023 4 жыл бұрын
very useful man! and as always right on time. Just as i start scratching my head you come up with something that just helps!! great!!!
@jeffborges101
@jeffborges101 4 жыл бұрын
wow . How nice ! A little JS code would be excellent ! . Kevin , I just bought and started your course on Scrimba. It is really amazing . I am learning a lot of things that was hard to understand before your class. A course that worth a way more than the discounted price. My knowledge of CSS and how the browsers " see " the things to be rendered (even if we don´t do nothing) had a major boost! This is a " must have " course for any front end developer Thank you very much
@busyrand
@busyrand 4 жыл бұрын
Just in time for me! I was looking for a straightforward way to do this exact thing without relying on plugins that were not good finished products just yet.
@Morrile1
@Morrile1 4 жыл бұрын
Awsome, as you say. Didn't realise CSS could have done that because I assumed it was something only JS could handle. I am certainly learning from you Kevin, albeit very busy with other stuff called work at the moment. Roll on December when I will have almost all of December to catch up.
@renzosolis4283
@renzosolis4283 4 жыл бұрын
yes, please do it! :)
@miezekatze2945
@miezekatze2945 4 жыл бұрын
I googled for a way to switch from light to dark mode some time ago and stumbled upon the media query approach but I never got around to try it, so it's nice to see it in action here! I'd also be very interested in seeing the js/toggle way! :D
@cristiano_skp3190
@cristiano_skp3190 4 жыл бұрын
Great video 👌. Js switch will be awesome 🙂
@sergeialekseenko3545
@sergeialekseenko3545 3 жыл бұрын
I have found great things. Thanks a lot!
@FirdavsiWebDev
@FirdavsiWebDev 4 жыл бұрын
Great tutorial,Kevin. Thank you so much!
@bikramchettri9405
@bikramchettri9405 4 жыл бұрын
Good trick can you do a video where we can particularly switch dark node on and off and save the preference to local storage?
@KevinPowell
@KevinPowell 4 жыл бұрын
That was the idea for the one with the toggle :D
@busyrand
@busyrand 4 жыл бұрын
@@KevinPowell Please do this ASAP! This was great.
@KevinPowell
@KevinPowell 4 жыл бұрын
It'll be out next Wednesday :)
@shaikshamsher7466
@shaikshamsher7466 4 жыл бұрын
Interested to see the javascript version
@BruceKoehler
@BruceKoehler 4 жыл бұрын
Hey Kevin, another great tutorial. I have been looking for a way to add a dark mode toggle to websites, and so I would enjoy that JS tutorial you mentioned
@KevinPowell
@KevinPowell 4 жыл бұрын
I might be doing it next week!
@BruceKoehler
@BruceKoehler 4 жыл бұрын
@@KevinPowell That's cool
@kennedycrispim3150
@kennedycrispim3150 4 жыл бұрын
Conheci seu canal recentemente e estou amando seus videos, parabéns pelo trabalho.
@digigoliath
@digigoliath 4 жыл бұрын
I am with the Dark side. A JS toggle? Hell, yeah!
@DailyIntern
@DailyIntern 4 жыл бұрын
Thank you Father of CSS.
@tahsinalmahi8769
@tahsinalmahi8769 4 жыл бұрын
Awesome!
@mtranchi
@mtranchi 4 жыл бұрын
js toggle with switching between bootstrap themes please. I do have a solution where it works, uses localStorage, but there's a flicker if the user has chosen my non-default setting. I could put a little javascript in the head that adds the css tag, but would that be detrimental regarding the speed of the rendering engine?
@KevinPowell
@KevinPowell 4 жыл бұрын
Hrm, curious what might cause that flicker. My JS version of this uses local storage
@mtranchi
@mtranchi 4 жыл бұрын
@@KevinPowell Probably the way I implemented it, it's been a while since I built that site. The default CSS tag linked to the standard Bootstrap, then I'd run javascript to switch the href attribute value to a Bootswatch dark theme based on localStorage. Maybe I put the javascript at the bottom of the page. Hope you decide to do the js toggle vid. Would be cool to see a solution that factored in both system preferences and a manual toggle. Thanks for your vids, CSS is definitely not my strong suit!
@adifeliz
@adifeliz 3 жыл бұрын
Thanks 😊
@LanFeusT23
@LanFeusT23 4 жыл бұрын
Very neat! Does this work on other OS too? Mac/Linux?
@KevinPowell
@KevinPowell 4 жыл бұрын
Any OS that supports a dark mode in the system settings, including android and iOS
@brandonbh04
@brandonbh04 Жыл бұрын
What if we already have a light/dark mode toggle, how do we initialize it according to the user's system settings?
@losmichaelos3508
@losmichaelos3508 4 жыл бұрын
please do the js switch as well. keep up the good work!
@anandtripathi9637
@anandtripathi9637 2 жыл бұрын
I made a button in website to switch on and off dark mode 🙂... but this is much cool ...
@carolmckay5152
@carolmckay5152 4 жыл бұрын
I used Sass colour maps. css variables are cool also of course.
@KevinPowell
@KevinPowell 4 жыл бұрын
I love Sass colour maps! It does take more work to create dynamic colour changes though. The JS toggle version I'll do next week would be able to use them though, since it toggles a class on and off.
@norvisnorvis7592
@norvisnorvis7592 4 жыл бұрын
Hi Kevin. This is a wonderful tutorial. Is Dark Mode needed for accessibility on the web?
@KevinPowell
@KevinPowell 4 жыл бұрын
For accessibility? Nah (at least I don't think so). Just more for user preference.
@betellopez3939
@betellopez3939 Жыл бұрын
I applied the @media query to my project (in this case CSS file) and it is not working. It only works when I click on "Enable automatic dark mode" on the inspector of google chrome and it uses some different color paletes from the ones I specified in the css file. How do you fix that?
@GrantHawkey
@GrantHawkey 4 жыл бұрын
Nice vid again! JS mode toggle video please!
@nicklebagkilla
@nicklebagkilla 3 жыл бұрын
Can you do a video (or series) on dark mode for email? Thanks.
@fvgoya
@fvgoya 4 жыл бұрын
Nice tutorial!!!! Please, shows to us with JavaScript as well. Thank you!
@syediqbalahmed3176
@syediqbalahmed3176 4 жыл бұрын
very good ...
@cthuloox476
@cthuloox476 3 жыл бұрын
If I'm using scss, should I use scss color variables, or should I change my code to use css :root variables instead?
@jordan992020
@jordan992020 2 жыл бұрын
Can you do a similar tutorial with a project where there is a button that switches the dark theme and where there are in the main html?
@remkospaans
@remkospaans 4 жыл бұрын
Let’s do the switch!
@KevinPowell
@KevinPowell 4 жыл бұрын
Seems like everyone wants the switch!
@SirMorak
@SirMorak 4 жыл бұрын
Why are you using var(someVar) instead of $someVar as you're using .scss?
@MoabeVettore
@MoabeVettore 4 жыл бұрын
Very useful, make video about JS toggle
@carolmckay5152
@carolmckay5152 4 жыл бұрын
Thing I learnt: you can't combine another media query (ie for size) with the media query for prefers-color-scheme, so I couldn't achieve a particular goal.
@RoboG0at
@RoboG0at 4 жыл бұрын
Would love to see the JavaScript version!
@CyberTechBits
@CyberTechBits 3 жыл бұрын
Can you show this using JavaScript?
@syediqbalahmed3176
@syediqbalahmed3176 4 жыл бұрын
nice ...
@tobyflenderson7176
@tobyflenderson7176 4 жыл бұрын
Please do the js version.
@blackpilledbuddha4944
@blackpilledbuddha4944 4 жыл бұрын
Hi kevin, can you pls do a video on useful keyboard shortcuts and other useful tips for vs code, that you regularly use
@2ddrewd
@2ddrewd 4 жыл бұрын
He just did one a few days ago. kzbin.info/www/bejne/p6GynXptd759orM
@KevinPowell
@KevinPowell 4 жыл бұрын
As Drew mentioned, that was my video last week!
@blackpilledbuddha4944
@blackpilledbuddha4944 4 жыл бұрын
@@KevinPowell wow .. thanks
@KevinPowell
@KevinPowell 4 жыл бұрын
Good timing :D
@monukumargautam2060
@monukumargautam2060 4 жыл бұрын
Can you make micro-interaction tutorial in CSS
@KevinPowell
@KevinPowell 4 жыл бұрын
A few people ahve mentioned it lately, I'll look into it for sure! Maybe do a mini-series on it or something :)
@malangope
@malangope 4 жыл бұрын
Does this work on the new dark and light modes on iOS devices?
@KevinPowell
@KevinPowell 4 жыл бұрын
It should :)
@bx_h23
@bx_h23 4 жыл бұрын
Does this work on Mac aswell?
@KevinPowell
@KevinPowell 4 жыл бұрын
Any OS that supports it, so as long as it's up to date, yes. Will work on iOS and Android too.
@Judas_Is_Fish
@Judas_Is_Fish 4 жыл бұрын
Waiting for toggle, Kevin)
@mmerle
@mmerle 4 жыл бұрын
Js switch please
@tbgan6675
@tbgan6675 4 жыл бұрын
JavaScript version please, thanks 🙏🏼
@Martin-4D
@Martin-4D 4 жыл бұрын
Noice :)
@kshitijnirale2015
@kshitijnirale2015 4 жыл бұрын
JS toggle pl.
@KevinPowell
@KevinPowell 4 жыл бұрын
It's coming tomorrow!
@chuck_norris
@chuck_norris 4 жыл бұрын
Dark Green? really
@KevinPowell
@KevinPowell 4 жыл бұрын
Haha, I didn't invest too much time figuring out the colour scheme, lol
@jongirma7273
@jongirma7273 4 жыл бұрын
toggle, toggle...
@KevinPowell
@KevinPowell 4 жыл бұрын
Tomorrow!
@weshuiz1325
@weshuiz1325 4 жыл бұрын
*how to troll people:* @media(prefers-color-cheme: dark){ body { background: #fff; } } @media(prefers-color-cheme: light){ body { background: #000; } }
@FordExplorer-rm6ew
@FordExplorer-rm6ew 4 жыл бұрын
Not real trolling but ok
CSS width auto vs 100% | What's the difference?
2:09
Kevin Powell
Рет қаралды 109 М.
5 CSS mistakes that I see way too often
19:03
Kevin Powell
Рет қаралды 359 М.
1ОШБ Да Вінчі навчання
00:14
AIRSOFT BALAN
Рет қаралды 4,8 МЛН
The FASTEST way to PASS SNACKS! #shorts #mingweirocks
00:36
mingweirocks
Рет қаралды 12 МЛН
مسبح السرير #قصير
00:19
سكتشات وحركات
Рет қаралды 11 МЛН
Dad Makes Daughter Clean Up Spilled Chips #shorts
00:16
Fabiosa Stories
Рет қаралды 6 МЛН
How to make a website light/dark toggle with CSS & JS
16:48
Kevin Powell
Рет қаралды 122 М.
Dark mode with TailwindCSS in under 7 minutes
6:58
Built With Code
Рет қаралды 34 М.
CSS Media Queries Tutorial for Responsive Design
11:38
Adrian Twarog
Рет қаралды 189 М.
How you can simplify your CSS with :is()
9:20
Kevin Powell
Рет қаралды 334 М.
All Your Color-Scheme Are Belong to Us
9:04
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 1,2 М.
Full Dark Mode with only 1 CSS PROPERTY?!
12:49
DesignCourse
Рет қаралды 157 М.
Light & Dark mode WITHOUT CSS!
11:42
Kevin Powell
Рет қаралды 106 М.
Are you writing responsive CSS the wrong way?
14:15
Kevin Powell
Рет қаралды 415 М.
React Dark Mode Toggle/Theme - Complete Guide
12:29
Code Complete
Рет қаралды 25 М.
Learn how to power-up your CSS with PostCSS
20:23
Kevin Powell
Рет қаралды 81 М.
1ОШБ Да Вінчі навчання
00:14
AIRSOFT BALAN
Рет қаралды 4,8 МЛН