forked from thoughtbot/bourbon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New addon to target only html5 input-types that are text-based (mimic…
…k input[type=text])
- Loading branch information
Phil LaPier
committed
Sep 23, 2011
1 parent
b8afdea
commit fb299e6
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//************************************************************************// | ||
// Generate a variable ($all-text-inputs) with a list of all html5 | ||
// input types that have a text-based input, excluding textarea. | ||
// http://diveintohtml5.org/forms.html | ||
//************************************************************************// | ||
$inputs-list: 'input[type="email"]', | ||
'input[type="number"]', | ||
'input[type="password"]', | ||
'input[type="search"]', | ||
'input[type="tel"]', | ||
'input[type="text"]', | ||
'input[type="url"]', | ||
|
||
// Webkit & Gecko may change the display of these in the future | ||
'input[type="color"]', | ||
'input[type="date"]', | ||
'input[type="datetime"]', | ||
'input[type="datetime-local"]', | ||
'input[type="month"]', | ||
'input[type="time"]', | ||
'input[type="week"]'; | ||
|
||
$list-count: 0; | ||
$unquoted-inputs-list: false; | ||
|
||
@each $input-type in $inputs-list { | ||
@if $list-count == 0 { | ||
$unquoted-inputs-list: unquote($input-type); | ||
$list-count: $list-count + 1; | ||
} | ||
|
||
@else if $list-count > 0 { | ||
$unquoted-inputs-list: join($unquoted-inputs-list, unquote($input-type), comma); | ||
} | ||
} | ||
|
||
$all-text-inputs: $unquoted-inputs-list; | ||
|
||
// You must use interpolation on the variable: | ||
// #{$all-text-inputs} | ||
//************************************************************************// | ||
// #{$all-text-inputs}, textarea { | ||
// border: 1px solid green; | ||
// } |
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