JSFiddle - React, Tailwind, and code Playground

HTML

<aside class="refinements" data-hasanyselected="false">
            <h2>REFINE BY</h2>
            <a href="#" class="clear-filter" data-clear="all">Clear All</a>
            <div class="panel" data-id="size" data-hasselections="false">
                <a href="#" class="refinement-header">
                    <h3>
                        <span class="facet-arrow" data-state="open"></span>
                        <span class="facet-name">Size</span>
                    </h3>
                </a>
                <a href="#" data-clear="size" class="clear-filter">Clear</a>
                <div class="options scrollable single-column">
                    <ul>
                        <li>
                            <input type="checkbox" id="size_1878"  />
                            <label for="size_1878">UK 4</label>
                        </li>
                        <li>
                            <input type="checkbox" id="size_1924"  />
                            <label for="size_1924">UK 6</label>
                        </li>
                        <li>
                            <input type="checkbox" id="size_1880"  />
                            <label for="size_1880">UK 8</label>
                        </li>
                        <li>
                            <input type="checkbox" id="size_1944"  />
                            <label for="size_1944">UK 10</label>
                        </li>
                        <li>
                            <input type="checkbox" id="size_2077"  />
                            <label for="size_2077">UK 12</label>
                        </li>
                        <li>
                            <input type="checkbox" id="size_1920"  />
                            <label for="size_1920">UK 14</label>
                        </li>
                        <li>
                            <input type="checkbox" id="size_1992"  />
                            <label for="size_1992">UK 16</label>
      ...

CSS

html {
  font-size: 20px;
}
ul, li {
  list-style: none;
  margin:0;
  padding:0;
}

.refinements {
  margin: 0 auto;
  width: 166px;
  position: relative;
}
.refinements a.refinement-header:active, .refinements a.refinement-header:hover, .refinements a.refinement-header:visited {
  color: #000;
}
.refinements h2 {
  border-bottom: 1px solid #999;
  color: #000;
  display: inline-block;
  font-family: Georgia;
  font-size: 1.02em;
  font-weight: normal;
  line-height: 1em;
  margin: 0;
  padding: 6px 0 15px;
  text-transform: uppercase;
  width: 100%;
}
.refinements[data-hasanyselected='False'] a.clear-filter,
.refinements[data-hasanyselected='false'] a.clear-filter {
  display: none;
}
.refinements a.clear-filter {
  color: #666;
  font-size: 0.65rem;
  font-weight: bold;
  position: absolute;
  right: 0;
  text-decoration: none;
  top: 4px;
}
.refinements a.clear-filter:hover {
  text-decoration: underline;
}
.refinements .panel {
  border-bottom: 1px solid #999;
  clear: both;
  padding: 0 0 6px;
  position: relative;
}
.refinements .panel:last-of-type {
  border: none;
}
.refinements .panel a {
  line-height: 0.95em;
  position: relative;
  text-decoration: none;
}
.refinements .panel a h3 {
  line-height: 0.9em;
  margin: 4px 0 1px;
  position: relative;
  text-transform: uppercase;
}
.refinements .panel a h3 span.facet-arrow[data-state='open'] {
  border-color: #666666 rgba(102, 102, 102, 0) rgba(102, 102, 102, 0) rgba(102, 102, 102, 0);
  border-style: solid;
  border-width: 5px;
  height: 0;
  width: 0;
  left: 1px;
  position: absolute;
  top: 10px;
}
.no-rgba .refinements .panel a h3 span.facet-arrow[data-state='open'] {
  border-color: #666666 transparent transparent transparent;
}
.ie7 .refinements .panel a h3 span.facet-arrow[data-state='open'], .ie8 .refinements .panel a h3 span.facet-arrow[data-state='open'] {
  border-width: 5px;
}
.refinements .panel a h3 span.facet-arrow[data-state='closed'] {
  border-color: rgba(102, 102, 102, 0) rgba(102,...

JavaScript

// 'Getting' data-attributes using getAttribute
var size = document.getElementById('size');
var base = document.getElementById('base_colour');
var brand = document.getElementById('brand');

var sizeCount = size.getAttribute('data-id');
var baseCount = base.getAttribute('data-id');
var brandCount = brand.getAttribute('data-id');






//When a panel has any number of facets selected, a “clear” button needs to be shown
$('input').on('click', function(){
    if ($('.option input:checkbox:checked').length > 0)    {
        // any one is checked        
    }
    else    {
       // none is checked
    }
 
});