Unqueue css file from specific page

I’m trying to unqueue style.css file from a specific page.

In my functions.php (child theme) if I add:

add_action( 'wp_enqueue_scripts', 'apc_child_desregistra_estilos', 11 ); function apc_child_desregistra_estilos() {     wp_dequeue_style( 'main-styles' ); } 

It works.

But when I add something like:

if (is_front_page()): wp_dequeue_style( 'main-styles' ); endif; 

It doesn’t.

I really don’t know what I am doing wrong.