title: Add class name only, conditonally
body: <p>I am using a plugin which determines the brightness of a div's background-color and dynamically applies a "light" or "dark" class to it. I'm trying to grab that class and apply it to another div in order to style it based on the returned value. </p>
  
  <pre><code>var topbar = $(".top-bar");
  if ($(".quote-block").is( "dark" ) ) {
      topbar.addClass('background--dark');
  };
  if ($(".quote-block").is( "light" ) ) {
      topbar.addClass('background--light');
  };
  </code></pre>
  
  <p>To streamline this however, it would be ideal to return just the class name alone and append it to the "background--" (i.e.: "background--" plus the "dark" class yielded by plugin, resulting in <code>.background--dark</code>). How can I achieve this with JQ? Clearly I am a novice so any insight would be greatly appreciated.</p>
  
  <p>This is the intended structure:</p>
  
  <pre><code>&lt;nav class="top-bar"&gt;&lt;/nav&gt;
  &lt;div class="main-content"&gt;
      &lt;section class="quote-block light&lt;--dynamic class"&gt;&lt;/section&gt;
      &lt;section class="quote-block dark&lt;--dynamic class"&gt;&lt;/section&gt;
  &lt;/div&gt;
  </code></pre>