Selectively transform content of sticky header on scroll

Good day. Is it possible to use custom pseudo classes, that would adjust size and look of elements inside sticky header so that I will not need to use custom css?
My idea is to be able defined own pseudo class, eg. :scrolling, which would resolve to custom selector, eg. header.sticky.scrolling, and while having the pseudo class active, I can define custom look of selected elements. I have tried but nothing seems to work so maybe writing extra CSS is the only way?