title: How do I properly add a background-color?
body: <p>I found a free custom Radiobutton which I implemented within my own code. But I'm struggling to make it work and having some issues with the functionality. Whenever I add a background-color to the parent object it doesn't change the buttons color when pressed. I have tried changing Z-index values on the parent object and some other things but nothing seems to work.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body{
    width: 100%;
    overflow-x: hidden;
    font-size: 17px;
    line-height: 30px;
    -webkit-transition: all 300ms linear;
    transition: all 300ms linear; 
  }
  
  [type="radio"]:checked,
  [type="radio"]:not(:checked){
    position: absolute;
    left: -9999px;
    width: 0;
    height: 0;
    visibility: hidden;
  }
  
  .checkbox-tools:checked + label,
  .checkbox-tools:not(:checked) + label{
    position: relative;
    display: inline-block;
    padding: 20px;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 1px;
    margin: 0 auto;
    margin-left: 5px;
    margin-right: 5px;
    margin-bottom: 10px;
    text-align: center;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    text-transform: uppercase;
    color: black;
    -webkit-transition: all 300ms linear;
    transition: all 300ms linear; 
  }
  .checkbox-tools:not(:checked) + label{
    background-color: white;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  }
  .checkbox-tools:checked + label{
    background-color: transparent;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.6);
  }
  .checkbox-tools:not(:checked) + label:hover{
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.6);
  }
  .checkbox-tools:checked + label::before,
  .checkbox-tools:not(:checked) + label::before{
    position: absolute;
    content: '';
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background-image: linear-gradient(298deg, yellow, green);
    z-index: -1;
  }
  
  /* .bg-color {
    background-color: grey;
    z-index: -999;
  } */</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="UTF-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  
      &lt;!-- Bootstrap --&gt;
      &lt;link
        rel="stylesheet"
        href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
        integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
        crossorigin="anonymous"
      /&gt; 
      
      &lt;title&gt;&lt;/title&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
  
      &lt;div class="container bg-color"&gt;
        &lt;div class="row pt-5"&gt;
          &lt;div class="col-12"&gt;
            &lt;input class="checkbox-tools test-tools" type="radio" name="typ-av-el" id="elhandel-button"&gt;          
            &lt;label class="for-checkbox-tools" for="elhandel-button"&gt;
              &lt;p&gt;button 1&lt;/p&gt;
            &lt;/label&gt;
            &lt;!--  --&gt;
            &lt;input class="checkbox-tools test-tools" type="radio" name="typ-av-el" id="elnät-button"&gt;
            &lt;label class="for-checkbox-tools" for="elnät-button"&gt;
              &lt;p&gt;button 2&lt;/p&gt;
            &lt;/label&gt;
          &lt;div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"
    integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"&gt;&lt;/script&gt;
  
    &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>The code snippet I sent works, but when the bg-color class is enabled it stops working. You no longer see the buttons changing into the linear-gradient color. Any solutions for this?</p>
  <p>Thanks in advance!</p>