Change style of Twenty Seventeen child theme

It’s probably a combination of css and js.
When you scroll down that is detected in Javascript, and then the JS either adds a class to that element, and the css that is written for that extra class gets activated, or the JS adds css inline or animates it with a function like the jQuery animate function.

Try to use inspecting in browser to figure out exactly what is happening, and narrow down the problem.