So I was playing around with a rather annoying website, trying to replace a background color on an element that was being styled by react’s styled-components.
Short of defining a CSS rule on something like… #rootElement > div >div >div:nth-of-type(3) > div > ....
it occured to me that I could find the element by the property I was trying to replace:
nav [fill="somevalue"] { fill: #someothervalue }
But that led me to think… well, thats an infinite loop - the browser would see the element with “somevalue”, change it to “someothervalue”…but then the element no longer matches the rule, so it would drop off… and then it would match… From what I can see, the Browser settled on the rule being applied.
So a general sort of question… do browsers handle this sort of situation cleanly, or would having this rule in place cause load on the browser as it constantly tries to fight itself?