title: Custom colors in Qt Designer stylesheets
body: <p>I'm trying to apply a custom color to several parts of a Qt GUI, using Qt designer and the main stylesheet.</p>
  
  <p>One solution would be using this:</p>
  
  <pre><code>#MainWindow{ background-color: #334422; }
  #first_label{ background-color: #334422; }
  #second_label{ background-color: #334422; }
  </code></pre>
  
  <p>But it is not scalable, what if I want to change that color again? So I tried to use this, that I think it'd work with web .css files:</p>
  
  <pre><code>.bg_color{ background-color: #334422; }
  #MainWindow{ .bg_color }
  #first_label{ .bg_color }
  #second_label{ .bg_color }
  </code></pre>
  
  <p>But I get an <code>Invalid stylesheet</code> message.</p>
  
  <p><a href="https://i.stack.imgur.com/ZZUJi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZZUJi.png" alt="enter image description here"></a></p>
  
  <p>Any ideas?</p>