@if (variable-exists(c-root)) {
	:root {
		@include clay-css($c-root);
	}

	[data-color-scheme='light']:root,
	:root [data-color-scheme='light'] {
		color-scheme: light;
	}
} @else {
	:root {
		// Custom variable values only support SassScript inside `#{}`

		@each $color, $value in $colors {
			--#{$color}: #{$value};
		}

		@each $color, $value in $theme-colors {
			--#{$color}: #{$value};
		}

		@each $bp, $value in $grid-breakpoints {
			--breakpoint-#{$bp}: #{$value};
		}

		// Use `inspect` for lists so that quoted items keep the quotes. See https://github.com/sass/sass/issues/2383#issuecomment-336349172

		--font-family-sans-serif: #{inspect($font-family-sans-serif)};
		--font-family-monospace: #{inspect($font-family-monospace)};
	}
}

@if (variable-exists(c-dark)) {
	[data-color-scheme='dark']:root,
	:root [data-color-scheme='dark'] {
		color-scheme: dark;

		@include clay-css($c-dark);
	}
}

@if (variable-exists(c-high-contrast)) {
	html:root {
		@media (prefers-contrast: more) {
			@include clay-css($c-high-contrast);
		}

		&[data-prefers-contrast='more'] {
			@include clay-css($c-high-contrast);
		}

		@media (forced-colors: active) {
			forced-color-adjust: none;

			@include clay-css($c-high-contrast);
		}
	}
}
