.header {
&__inner {
display: flex;
justify-content: space-between;
height: 100px;
}
}
.header__fixed {
position: fixed;
height: 100px;
top: 0;
left: 0;
right: 0;
background-color: red;
}
const headerFixed = document.querySelector('.header');
window.addEventListener('scroll', () => {
if (window.pageYoffset > 100) {
headerFixed.classList.add('header__fixed')
} else {
headerFixed.classList.remove('header__fixed')
}
})