Angular, Web Development, Tailwind Css, Rxjs, Tutorial.
shadow-lg opacity-95 bg-white': (isSticky$ | async) === true}" > .... </nav> `, }) export class NavBarComponent { public readonly isSticky$ = fromEvent(window, 'scroll').pipe( map((x) => window.scrollY), distinctUntilChanged(), map((scrollTop: number) => scrollTop > 24) ); } Explanation: public