I found out by trial and error that the easiest way to fix that was to add an id to the entire jsx file and in css just use that id for the entire code. eg: #id_name{ //your entire css }