@function lighten($color, $amount) { @return hsl(hue($color), saturation($color), lightness($color) - $amount); } @function darken($color, $amount) { @return hsl(hue($color), saturation($color), lightness($color) + $amount); } @function theme-color-level($color-name: "primary", $level: 0) { $color: theme-color($color-name); $color-base: if($level < 0, #000, #fff); $level: abs($level); @return mix($color-base, $color, $level * $theme-color-interval); }