מצב אור וחושך בלי CSS!

110.3K צפיות 21/04/2022
תכנות,Kevin Powell

דרג סרטון זה

התחבר כדי לדרג

תיאור

The color-scheme property is a super useful property. It allows us to switch the UI elements, like form controls, scrollbars, and all that to light or dark modes, but it also has a meta tag that we can use as well, allowing us to create light and dark modes without even writing any CSS!

🔗 Links
✅ Polypane: https://a.paddle.com/v2/click/39438/133152?link=3110 (this is an affiliate link, so if you do purchase, it would also help support my channel)
✅ A really in-depth article that helped me put this video together: https://web.dev/color-scheme/

⌚ Timestamps
00:00 - Introduction
00:59 - The problem with the prefers-color-scheme media query
02:38 - Setting a default color-scheme
04:15 - light and dark modes with color-scheme
05:05 - Using color-scheme with prefers-color-scheme
06:22 - the color-scheme meta tag
07:33 - Setting color-scheme on individual elements
09:55 - differences between browsers

#css

--

Come hang out with other dev's in my Discord Community
💬 https://discord.gg/nTYCvrK

Keep up to date with everything I'm up to
https://www.kevinpowell.co/newsletter

Come hang out with me live every Monday on Twitch!
📺 https://www.twitch.tv/kevinpowellcss

---

Help support my channel
👨‍🎓 Get a course: https://www.kevinpowell.co/courses
👕 Buy a shirt: https://teespring.com/stores/making-the-internet-awe...
💖 Support me on Patreon: https://www.patreon.com/kevinpowell

---

My editor: VS Code - https://code.visualstudio.com/

---

I'm on some other places on the internet too!

If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me on Instagram and Twitter.

Twitter: https://twitter.com/KevinJPowell
Codepen: https://codepen.io/kevinpowell/
Github: https://github.com/kevin-powell

---

And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!

NeTube Bot
פעיל עכשיו