//
// Spotlight Mixins
//

// Spottable elements
.spottable(@rules; @target) when (isruleset(@rules)) and (@target = parent) {
	:global(.spottable) {
		@rules();
	}
}
.spottable(@rules) when (isruleset(@rules)) {
	&:global(.spottable) {
		@rules();
	}
}

// Focused Spottable elements
.focus(@rules; @target) when (isruleset(@rules)) and (@target = parent) {
	:global(.spotlight-input-key) &,
	:global(.spotlight-input-mouse) & {
		.spottable({
			&:focus {
				@rules();
			}
		}, @target);
	}

	:global(.spotlight-input-touch) & {
		.spottable({
			&:active {
				@rules();
			}
		}, @target);
	}
}
.focus(@rules) when (isruleset(@rules)) {
	:global(.spotlight-input-key) &,
	:global(.spotlight-input-mouse) & {
		.spottable({
			&:focus {
				@rules();
			}
		});
	}

	:global(.spotlight-input-touch) & {
		.spottable({
			&:active {
				@rules();
			}
		});
	}
}

// Muted elements
.muted(@rules; @target) when (isruleset(@rules)) and (@target = parent) {
	[data-spotlight-container-muted="true"] {
		@rules();
	}
}
.muted(@rules) when (isruleset(@rules)) {
	&[data-spotlight-container-muted="true"] {
		@rules();
	}
}
