@use '../../scss/theming' as *;

@mixin daff-spinner-light-variant($loader-color) {
	.daff-spinner__track,
	.daff-spinner__path {
		stroke: $loader-color;
	}

	.daff-spinner__path {
		stroke: $loader-color;
	}
}

@mixin daff-spinner-dark-variant($loader-color) {
	.daff-spinner__track {
		stroke: $loader-color;
	}

	.daff-spinner__path {
		stroke: $loader-color;
	}
}

@mixin daff-spinner-theme($theme) {
	$primary: daff-get-palette($theme, primary);
	$secondary: daff-get-palette($theme, secondary);
	$tertiary: daff-get-palette($theme, tertiary);
	$base: daff-get-base-color($theme, base);
	$base-contrast: daff-get-base-color($theme, base-contrast);
	$white: daff-get-base-color($theme, 'white');
	$black: daff-get-base-color($theme, 'black');

	.daff-spinner {
		&.daff-primary {
			@include daff-spinner-light-variant(daff-color($primary));
		}

		&.daff-secondary {
			@include daff-spinner-light-variant(daff-color($secondary));
		}

		&.daff-tertiary {
			@include daff-spinner-light-variant(daff-color($tertiary));
		}

		&.daff-theme {
			@include daff-spinner-light-variant($base);
		}

		&.daff-theme-contrast {
			@include daff-spinner-light-variant($base-contrast);
		}

		&.daff-dark {
			@include daff-spinner-light-variant($black);
		}

		&.daff-light {
			@include daff-spinner-light-variant($white);
		}
	}
}
