JSFiddle - React, Tailwind, and code Playground

by webphp

HTML

<header class="header">
   <div class="select">
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
     <p><a href="#">Test</a></p>
   </div>
</header>

CSS

* {
    margin: 0;
    padding: 0;
}
.header {
    position: fixed;
    display: flex;
    align-items: center;
    top: 0;
    left: 0;
    right: 0;
    background: green;
    color: #bbbdc0;
    z-index: 1;
    height: 60px;
    padding: 0 1.75rem;
    transition: .15s background ease-in-out;
    
}
.select {
    position: fixed;
    background: orange;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 2;
  
}
.transform {
  -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

JavaScript

setInterval(function() {
	var e = document.querySelector(".header");
  return e.classList.contains("transform")
  	? e.classList.remove("transform")
    : e.classList.add("transform")
}, 1000)