How to exclude a "CSS enqueue" from the Bricks building page

I’ve enqueue a CSS stylesheet on my frontend using very common code:
add_action(‘wp_enqueue_scripts’, ‘jy_enqueue_css_jy_color’);

The CSS in indeed enqueue on all my WordPress pages, BUT it’s also included on the Bricks building page (where I build the website).

PROBLEM: my CSS ruin the “Bricks building page own CSS”.

=> Is it possible to enqueue a CSS, but ONLY on the frontend website pages, and NOT on Bricks building page?

Thank you a lot for your help!

I got it, the solution is available on this page:

The code below will enqueue a CSS stylesheet inside the [Bricks Editor User Canvas], BUT won’t affect the [Brick Editor Panel].

/*===========================
add_action(‘wp_enqueue_scripts’, ‘jy_enqueue_css_test’);

function jy_enqueue_css_test() {
if ( bricks_is_builder() && ! bricks_is_builder_main() ) {
$url = get_home_url() . ‘/wp-content/uploads/css/jy-test.css’;
$name = ‘jy-test’;
wp_register_style($name, $url, ‘’, ‘1.0’, ‘all’);
wp_enqueue_style($name);
}
}
===========================*/

If you want to also enqueue the CSS on other part - typically the website [Frontend], or [Bricks Editor Panel] - here are the codes. This page

/---------------------------
Show on [Bricks Editor Panel] + [Bricks Editor User Canvas], but not on [Frontend].
---------------------------
/
if ( bricks_is_builder() ) {
}

/---------------------------
Show only on [Bricks Editor Panel].
---------------------------
/
if ( bricks_is_builder_main() ) {
}

/---------------------------
Show only on [Bricks Editor User Canevas].
---------------------------
/
if ( bricks_is_builder() && ! bricks_is_builder_main() ) {
}

/---------------------------
Show on [Frontend] and [Bricks Editor User Canvas], but not on [Bricks Editor Panel].
---------------------------
/
if ( ! bricks_is_builder_main() ) {
}

/---------------------------
Show only on [Frontend].
---------------------------
/
if ( bricks_is_frontend() ) {
}

2 Likes