/* FILE: _variables/_theme-options.scss */
@use 'sass:string';

/*! Vars: Theme mods: */
:root {

	// `$value + ''` is converting values to string to prevent any issues.
	@each $option, $value in $theme_options {

		// Not WP preset (`theme.json`) CSS variables.
		@if (
			not string.index( $option + '', '--wp--' )
			and not string.index( $value + '', '--wp--' )
		) {
			#{ $option }: #{ $value + '' };
		}
	}
}

#{$root} {

	// `$value + ''` is converting values to string to prevent any issues.
	@each $option, $value in $theme_options {

		// WP preset (`theme.json`) CSS variables need to be defined on root based on WP Global Styles.
		@if (
			string.index( $option + '', '--wp--' )
			or string.index( $value + '', '--wp--' )
		) {
			#{ $option }: #{ $value + '' };
		}
	}
}
