Check out example codes for "css focus change color". It will help you in understanding the concepts better.

Code Example 1

<style>
.dabutton:focus {
    background-color:yellow;
}
</style>
<button class="dabutton"></button> // <-- usage

Code Example 2

/*Changing the color the red when it starts*/
body{
  background-color: red;
}

/*Changing the color to blue when you focus on the window*/
body:focus{
  background-color: blue;
}

Learn ReactJs, React Native from akashmittal.com