Skip to content

Commit

Permalink
add text-input component
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewGibson27 committed Aug 8, 2019
1 parent 986af71 commit 4b094fb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/scss/6-components/_all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
@import 'story-body/story-body';
@import 'table/table';
@import 'tabs/tabs';
@import 'text-input/text-input';
20 changes: 20 additions & 0 deletions assets/scss/6-components/text-input/_text-input.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Text input (c-text-input)
//
// Text form inputs. Can be used with type="text", type="email", etc. Add .is-valid if the value is not valid.
//
// Markup: 6-components/text-input/text-input.html
//
// Styleguide 6.1.5
.c-text-input {
-webkit-appearance: none;
border-color: $color-gray-light;
border-radius: 0;
border-style: solid;
border-width: 1px;
line-height: $line-height-b;
padding: $size-xxs;

&.is-invalid {
border-color: $color-error;
}
}
14 changes: 14 additions & 0 deletions assets/scss/6-components/text-input/text-input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div>
<label for="firstName" class="l-display-block has-xxxs-btm-marg t-size-s">
<strong>First name</strong>
</label>
<input id="firstName" name="firstName" type="text" value="Cosmo Kramer" class="c-text-input l-display-block l-width-full has-text-gray-dark is-invalid has-xxxs-btm-marg" aria-invalid="true">
<ul>
<li class="has-text-error has-xxxs-btm-marg t-size-xs">
First validation error
</li>
<li class="has-text-error t-size-xs">
Second validation error
</li>
</ul>
</div>

0 comments on commit 4b094fb

Please sign in to comment.