<div onclick="window.history.back()" class="carrot-back-button np-hidden-desktop">
  <i class="fas fa-chevron-left"></i>
  Back
</div>

<style>
  .carrot-back-button {
    background-color: var(--np-header-color);
    color: white;
    font-weight: 400;
    padding: 10px 16px;
    cursor: pointer;
  }
</style>

<script>
  window.history.scrollRestoration = 'manual';
  if(window.history.length > 1) {
    document.querySelector('.carrot-back-button').style.display = 'block';
  } else {
    document.querySelector('.carrot-back-button').style.display = 'none';
  }
</script>