<?php
// Add the filter and function to your functions.php file

add_filter('body_class', 'add_slug_to_body_class');

function add_slug_to_body_class($classes) {
	global $post;
	if(is_page()) {
		$classes[] = sanitize_html_class($post->post_name);
	} elseif(is_singular()) {
		$classes[] = sanitize_html_class( $post->post_name );
	};
	return $classes;
}
?>