update styles
add .invalid class when selector is invalid