Mega Man Mega Man - 4 months ago 21
CSS Question

SASS inverse select of input types

I need to apply a class

.invalid
to all input types but email and password

input{
&[type="everything but email and password"]
.invalid{
//styles
}

}

Answer

With CSS :not() selector you can achieve it.

input{
   &:not([type="email"]):not([type="password"]) {
     .invalid{
       //styles
     }
   }
}