Create a color theme mixin with Sass

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUI12 min

About this video

Kevin Powell walks through building a Sass mixin that applies a color theme, adding arguments, an if/else statement for gradients, and support for custom colors. It suits developers who already write CSS and want to structure theming in Sass.

What you’ll learn

  • Write a Sass mixin that accepts theme variables as arguments
  • Use if/else logic in a Sass mixin to switch between colour and gradient output
  • Extend a Sass theme mixin to accept custom colours