To target all siblings of a node matching div:has-text(Test) using uBlock Origin, you can use the following cosmetic filter rule:
plaintextdiv:has-text(Test) ~ *
div:has-text(Test) selects the <div> element containing the text "Test".~ * selects all following siblings of that <div>.uBlock Origin's cosmetic filters do not support selecting previous siblings directly in CSS. However, you can use the following approach to target all children of the parent (which includes all siblings):
plaintextdiv:has-text(Test) > .. > *:not(div:has-text(Test))
div:has-text(Test) > .. selects the parent of the <div>.> *:not(div:has-text(Test)) selects all children of the parent except the original <div>.Le Chat can make mistakes. Check answers. Learn more