Possible to make borders invisable on empty areas?

Permalink
Imagine I got a simple area that can be added by a user:

<div class="col-lg-12 Area_1">
      <div class="row">
         <?php
            $a = new Area('Area 1');
            $a->display($c);
         ?>
      </div>
   </div>


Now in the css I give the Area_1 a solid border of 1px; Now when a user hasn't added a block to this area, it simply shows a thin small line.
Is there a way to make borders not show up if there's no block or stack added to an empty area?

 
ramonleenders replied on at Permalink Reply
ramonleenders
Something like this?

<style>
        .Area_1.no-blocks {
            border: 1px solid red;
        }
    </style>
    <?php
    $area1 = new Area('Area 1');
    $area1Classes = array();
    if ($c->isEditMode()) {
        $area1Classes = array('Area_1');
        if ($area1->getTotalBlocksInArea($c) <= 0) {
            $area1Classes[] = 'no-blocks';
        }
    } ?>
    <div class="col-lg-12<?php echo !empty($area1Classes) ? ' ' . implode(' ', $area1Classes) : null; ?>">
ghoststalker194 replied on at Permalink Reply
That looks pretty good! I'll try it when I get home.