Import all Catppuccin flavors using the single-map file
mainTo access all four flavors at once, import _catppuccin.scss. This provides a $palette map containing all flavor color maps. You can iterate over this map using Sass @each loops to generate styles for every flavor.
Important: When retrieving colors from the map using map.get, you must wrap the color name in quotes (e.g., 'blue' instead of blue). This prevents Sass from confusing color names with predefined CSS web-safe colors.
If using the @catppuccin/palette npm package, use the path: @catppuccin/palette/scss/catppuccin.
@use "sass:map";
@use "catppuccin";
// or via npm:
// @use "~@catppuccin/palette/scss/catppuccin";
@each $flavor, $color in catppuccin.$palette {
.my-#{$flavor}-class {
// wrap color names in quotes to ensure proper generation
background: #{map.get($color, 'base')};
color: #{map.get($color, 'blue')};
}
}