@KevinPowell
  @KevinPowell
Kevin Powell | A deep dive into CSS color-mix() @KevinPowell | Uploaded August 2023 | Updated October 2024, 6 hours ago.
Another feature making its way in from preprocessors like Sass, we can now mix colors in CSS!

In this one, I go over the basics of how it works, look at how we can play with the percentages, what happens when the percentages are below 100% total, how the different color models work, and how we can mix colors in different directions (which doesn’t sound like it should be a thing, but it is πŸ˜…).

I also take a very quick look at how we can create color schemes by using color-mix() as well, to help show a little bit of a more practical example of it in action.


πŸ”— Links
βœ… Browser support for color-mix(): caniuse.com/mdn-css_types_color_color-mix
βœ… All the codepens from this video: codepen.io/collection/BNOMbj
βœ… CSS color-mix() on the Chrome Developers Blog: developer.chrome.com/blog/css-color-mix
βœ… CSS color-mix() MDN article: developer.mozilla.org/en-US/docs/Web/CSS/color_value/color-mix
βœ… More on the different color models: developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb_color_model

⌚ Timestamps
00:00 - Introduction
00:30 - The very basics
02:20 - Mixing specific percentages of each color
04:00 - When the percentages don’t equal 100%
05:35 - The color models
08:40 - lab, oklab, lch, and oklch
10:25 - mixing colors in different directions
14:32 - Creating a color scheme with color-mix(

#css

--

Come hang out with other dev's in my Discord Community
πŸ’¬ discord.gg/nTYCvrK

Keep up to date with everything I'm up to
βœ‰ kevinpowell.co/newsletter

Come hang out with me live every Monday on Twitch!
πŸ“Ί twitch.tv/kevinpowellcss

---

Help support my channel
πŸ‘¨β€πŸŽ“ Get a course: kevinpowell.co/courses
πŸ‘• Buy a shirt: teespring.com/stores/making-the-internet-awesome
πŸ’– Support me on Patreon: patreon.com/kevinpowell

---

My editor: VS Code - 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: twitter.com/KevinJPowell
Codepen: codepen.io/kevinpowell
Github: 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!
A deep dive into CSS color-mix()How I build a website from scratchI never thought of using CSS animations like this before!How to escape the container on only one sideThe easy way to make sense of complex selectorsAnimate CSS Shadows With This Trick...Responsive layout practice for beginnersThis new CSS property just solved animating to height autoPower-up position absolute with this simple techniqueThe only tags you need when first learning HTMLUse this instead of media queries or container queriesKeeping up with CSS: The features released in 2023

A deep dive into CSS color-mix() @KevinPowell

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER