Skip to content

Commit

Permalink
Merge pull request #474 from alphagov/add-textarea
Browse files Browse the repository at this point in the history
Add a textarea example to the form elements page
  • Loading branch information
gemmaleigh authored May 30, 2017
2 parents d96919c + 7d144f5 commit a37b20e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
20 changes: 20 additions & 0 deletions app/views/guide_form_elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ <h2 class="heading-small heading-contents">Contents:</h2>
<li><a href="#form-optional-fields">Optional and mandatory fields</a></li>
<li><a href="#form-labels">Labels</a></li>
<li><a href="#form-fields">Form fields</a></li>
<li><a href="#form-textarea">Textarea</a></li>
<li><a href="#form-focus-states">Form focus states</a></li>
<li><a href="#form-hint-text">Hint text</a></li>
<li><a href="#form-spacing">Spacing</a></li>
Expand Down Expand Up @@ -86,6 +87,25 @@ <h3 class="heading-medium" id="form-fields">Form fields</h3>
</a>
</p>

<h3 class="heading-medium" id="form-textarea">Textarea</h3>
<div class="text">
<p>
Make the height of a textarea proportional to the amount of text to be entered.
</p>
</div>

<div class="example">
{% include "snippets/form_textarea.html" %}
</div>

<pre>
<code class="language-markup">
{% filter escape %}
{% include "snippets/form_textarea.html" %}
{% endfilter %}
</code>
</pre>

<h3 class="heading-medium" id="form-focus-states">Form focus states</h3>
<div class="text">
<p>
Expand Down
4 changes: 4 additions & 0 deletions app/views/snippets/form_textarea.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<label class="form-label" for="textarea">
Why can't you provide a National Insurance number?
</label>
<textarea class="form-control form-control-3-4" name="textarea" id="textarea" rows="5"></textarea>
9 changes: 7 additions & 2 deletions assets/sass/elements/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,16 @@ textarea {
// scss-lint:disable QualifyingElement
input.form-control,
textarea.form-control {
// Remove inner shadow
// Disable inner shadow and remove rounded corners
-webkit-appearance: none;
// Remove rounded corners
border-radius: 0;
}

textarea.form-control {
// Disable opacity and background image for Firefox
opacity: 1;
background-image: none;
}
// scss-lint:enable QualifyingElement


Expand Down

0 comments on commit a37b20e

Please sign in to comment.