joewoodward
joewoodward

Reputation: 263

Add another element type to definition using Sass§

Is it possible to add another element to a definition something like

input {
    &:not[type="submit"], &,textarea {
        // styles that apply to inputs that are not submit buttons, and text areas
    }
    // other styles here that I don't want to apply to textareas
    // do want to apply to inputs
}

I've had a look through the sass documentation but can't see anything, if anyone can suggest a way to do this that would be awesome.

Thanks

Upvotes: 0

Views: 120

Answers (1)

cimmanon
cimmanon

Reputation: 68319

No, this is not possible. Keep in mind that nesting is a feature, not a requirement. Nest when it makes sense, don't nest when it doesn't.

Your problem might be better solved with this answer, since there are more than 2 subsets of input elements (text, date, button, checkbox/radio, slider, color picker, etc.) and styles that should be applied to text style inputs generally don't work well on any other type.

Upvotes: 2

Related Questions