How do you define attribute selectors in SASS?
83,106
Solution 1
You can also nest it like this
input
&[type="submit"]
....
&[type="search"]
....
Solution 2
This converter website says:
input[type=submit]
// properties
Comments
-
gigimon over 2 years
In CSS, you can do this:
input[type=submit] { // properties }
It's a very useful for styling form buttons.
How do you do the same thing in SASS?
-
Jasper Kennis about 12 yearsI like this approach a lot since you'd often do this kind of thing to serve the right image from a sprite, in a toolbar or set of social links.
-
Terry Lin over 6 yearsAdding double quote doesn't work. This shouldn't be correct answer.
-
user3260487 over 5 years&[type='submit']
-
Marcelo Velasquez over 3 yearsThe link is Broken
-
Alexander Ryan Baggett over 3 yearsCan someone put out a FULL and complete correct answer including some values being set?