Last active
December 18, 2015 04:49
-
-
Save msweeney/5728175 to your computer and use it in GitHub Desktop.
Selector shorthand in SASS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$texty-inputs: | |
'input[type="text"], | |
input[type="password"], | |
input[type="email"], | |
input[type="url"], | |
input[type="date"], | |
input[type="month"], | |
input[type="time"], | |
input[type="datetime"], | |
input[type="datetime-local"], | |
input[type="week"], | |
input[type="number"], | |
input[type="search"], | |
input[type="tel"], | |
input[type="color"]'; | |
.pure-form { | |
#{$texty-inputs}, | |
label, | |
select { | |
display: block; | |
margin-bottom: 1em; | |
} | |
} | |
.pure-group { | |
#{$texty-inputs}, | |
label, | |
select { | |
margin-bottom: 0; | |
} | |
} | |
// yields | |
.pure-form input[type="text"], | |
.pure-form input[type="password"], | |
.pure-form input[type="email"], | |
.pure-form input[type="url"], | |
.pure-form input[type="date"], | |
.pure-form input[type="month"], | |
.pure-form input[type="time"], | |
.pure-form input[type="datetime"], | |
.pure-form input[type="datetime-local"], | |
.pure-form input[type="week"], | |
.pure-form input[type="number"], | |
.pure-form input[type="search"], | |
.pure-form input[type="tel"], | |
.pure-form input[type="color"], | |
.pure-form label, | |
.pure-form select { | |
display: block; | |
margin-bottom: 1em; } | |
.pure-group input[type="text"], | |
.pure-group input[type="password"], | |
.pure-group input[type="email"], | |
.pure-group input[type="url"], | |
.pure-group input[type="date"], | |
.pure-group input[type="month"], | |
.pure-group input[type="time"], | |
.pure-group input[type="datetime"], | |
.pure-group input[type="datetime-local"], | |
.pure-group input[type="week"], | |
.pure-group input[type="number"], | |
.pure-group input[type="search"], | |
.pure-group input[type="tel"], | |
.pure-group input[type="color"], | |
.pure-group label, | |
.pure-group select { | |
margin-bottom: 0; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment