Check if sidebar is rendered?

If your certain sidebar widget area is page-specific then I think you need to load classes only to those pages. If so, use is_page() with it:

if( is_page('that-page') && is_active_sidebar('your-sidebar') ) {
     $class="your-class ";
}

If it’s true for all the inner pages other than the front-page, use:

if( !is_front_page() && is_active_sidebar('your-sidebar') ) {
     $class="your-class ";
}

I think this is the PHP way.

tech