Whether the site is being previewed in the Customizer.

Signature

is_customize_preview()

Return

(boolean) True if the site is being previewed in the Customizer, false otherwise.

Source

function is_customize_preview() {
	global $wp_customize;

	return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
}
WP Trac GitHub

Link here