Skip to content

Commit

Permalink
feat(textarea): adds textarea styles
Browse files Browse the repository at this point in the history
affects: @buildit/gravity-ui-nunjucks, @buildit/gravity-ui-web

ISSUES CLOSED: #404
  • Loading branch information
James Nash committed Apr 16, 2020
1 parent 3da72b6 commit dba6efa
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 1 deletion.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"preview": "@form-input-preview",
"context": {
"type": "text"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Purpose

A `textarea` is used to capture multiline text input from the user.

If the input must be completed in order to process the form successfully then a `required` attribute can be added. This will prevent the form being submitted until the `textarea` has a value.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"preview": "@form-input-preview",
"context": {
"inputText": "Pedantic shitpost comment goes in here"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<textarea>{{ inputText }}</textarea>
17 changes: 17 additions & 0 deletions packages/gravity-ui-web/src/sass/03-elements/_input.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
label {
display: block;

> textarea {
width: 100%;
margin-top: $grav-sp-s;
}
}

input:not([type=radio]):not([type=checkbox]) {
width: 100%;
max-width: 40ch;
Expand All @@ -6,3 +15,11 @@ input:not([type=radio]):not([type=checkbox]) {
border: grav-px2rem(1) solid var(--grav-co-grp-b-neutral);
background-color: var(--grav-co-grp-a-neutral);
}

textarea {
display: block;
padding-right: $grav-sp-xs;
padding-left: $grav-sp-xs;
border: grav-px2rem(1) solid var(--grav-co-grp-b-neutral);
background-color: var(--grav-co-grp-a-neutral);
}

0 comments on commit dba6efa

Please sign in to comment.