@use 'sass:map';
@use "@angular/material" as mat;
@use '../global/index' as global;
@use '../themes/index' as themes;

@mixin override-color($theme) {
	$-theme: map.get($theme, theme);
	$color-config: mat.get-color-config($theme);
	$primary-palette: map.get($color-config, "primary");

	.mat-button-toggle {
		background: if($-theme == "dark", themes.dark-color-overlay(4), themes.light-color-overlay(0));

		&.mat-button-toggle-checked {
			background: map.get($primary-palette, default);
			color: if($-theme == "dark", #000000, #ffffff);
		}
	}
}

@mixin override-theme($theme) {
	$color-config: mat.get-color-config($theme);
	@if $color-config != null {
		@include override-color($theme);
	}
}
