Ideally, CSS would have a selector that combines [attr~=value] and [attr$=value] where you could write [attr~$=value] to match any element where attr is a space-separated list of keywords and one of them ends with value.
That way one could just check [class~$="--modifier"] in a relatively safe way. At that point, the only problem would be .foo-list__foo--test and .bar-list__bar--test would both match the --test selector, but that's probably a good bit less likely.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ideally, CSS would have a selector that combines
[attr~=value]
and[attr$=value]
where you could write[attr~$=value]
to match any element whereattr
is a space-separated list of keywords and one of them ends withvalue
.That way one could just check
[class~$="--modifier"]
in a relatively safe way. At that point, the only problem would be.foo-list__foo--test
and.bar-list__bar--test
would both match the--test
selector, but that's probably a good bit less likely.