<article>
  <label for="rating">Popularity
    <span title="Rating 2.5 of 5" class="meter" style="--current: 2.5">
    <meter name="rating" value="2.5" min="0" max="5">Rating 2.5 of 5</meter>
  </span>
  </label>
</article>
$star: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 12.408l-11.056-1.607-4.944-10.018-4.944 10.018-11.056 1.607 8 7.798-1.889 11.011 9.889-5.199 9.889 5.199-1.889-11.011 8-7.798z"></path></svg>');

:root {
  --space: 1.25rem;
  --max: 5;
  --size: 2em; // Value has to be Integer
  --inactive: hsl(0, 0%, 88%);
  --active: hsl(32, 85%, 51%);
  --star: #{$star};
}

// If you are going to use viewport units for font size, things get a bit tricky
/*
html {
  font-size: 4.8vmin;
  
  @media (orientation: landscape) {
    font-size: 1.2vw; 
  }
  
  .meter {
    --size: 2em; // Fix for viewport font sizes. PS: --size must be in ems here
    font-size: 18px; 
  
    @media (orientation: landscape) {
      font-size: 12px;
    }
  }
}
*/

.meter {
  meter {
    display: none;
  } 
  display: inline-block;
  width: calc(var(--size) * var(--max));
  height: var(--size);
  position: relative;
  
  &::before,
  &::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    mask: left center/contain;
    mask-image: var(--star);
  }
  
  &::before{
    background: var(--inactive); 
  }
  
  &::after {
    content: '';
    z-index: 1;
    background: var(--active);
    right: calc(100% - (var(--current) / var(--max) * 100%)); 
  }
}


article {
  padding: var(--space);
    
  label {
    display: flex;
    flex-flow: columns;
    align-items: center;
    font-weight: bold;
    
    span {
      margin-left: var(--space);
    }
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.