DRY css name validation in a custom validator.