Skip to content

Commit

Permalink
fix(form): transparent input padding and texarea support
Browse files Browse the repository at this point in the history
Closes ##798
  • Loading branch information
lubber-de authored and Sean committed Jun 10, 2019
1 parent bfd7c84 commit dd561b5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
7 changes: 5 additions & 2 deletions src/definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
}

/* Text Area */
.ui.input textarea,
.ui.form textarea {
margin: 0;
-webkit-appearance: none;
Expand Down Expand Up @@ -186,19 +187,21 @@
Transparent
---------------------*/

.ui.form .field .transparent.input input,
.ui.form .field .transparent.input:not(.icon) input,
.ui.form .field input.transparent,
.ui.form .field textarea.transparent {
padding: @transparentPadding !important;
padding: @transparentPadding;
}

.ui.form .field input.transparent,
.ui.form .field textarea.transparent {
border-color: transparent !important;
background-color: transparent !important;
box-shadow: none !important;
}

.ui.form .field.error .transparent.input input,
.ui.form .field.error .transparent.input textarea,
.ui.form .field.error input.transparent,
.ui.form .field.error textarea.transparent {
background-color: @transparentFormErrorBackground !important;
Expand Down
36 changes: 21 additions & 15 deletions src/definitions/elements/input.less
Original file line number Diff line number Diff line change
Expand Up @@ -211,22 +211,25 @@
.ui.transparent.input > input {
border-color: transparent !important;
background-color: transparent !important;
padding: 0 !important;
padding: 0;
box-shadow: none !important;
border-radius: 0 !important;
}
.field .ui.transparent.input > textarea {
padding: @padding;
}

/* Transparent Icon */
.ui.transparent.icon.input > i.icon {
:not(.field) > .ui.transparent.icon.input > i.icon {
width: @transparentIconWidth;
}
.ui.transparent.icon.input > input {
padding-left: 0 !important;
padding-right: @transparentIconMargin !important;
:not(.field) > .ui.transparent.icon.input > input {
padding-left: 0;
padding-right: @transparentIconMargin;
}
.ui.transparent[class*="left icon"].input > input {
padding-left: @transparentIconMargin !important;
padding-right: 0 !important;
:not(.field) > .ui.transparent[class*="left icon"].input > input {
padding-left: @transparentIconMargin;
padding-right: 0;
}

/* Transparent Inverted */
Expand Down Expand Up @@ -271,9 +274,9 @@
.ui.icon.input > i.icon:not(.link) {
pointer-events: none;
}
.ui.icon.input > textarea,
.ui.icon.input > input {
padding-right: @iconMargin !important;
.ui.ui.icon.input > textarea,
.ui.ui.icon.input > input {
padding-right: @iconMargin;
}

.ui.icon.input > i.icon:before,
Expand Down Expand Up @@ -303,10 +306,10 @@
right: auto;
left: @circularIconHorizontalOffset;
}
.ui[class*="left icon"].input > textarea,
.ui[class*="left icon"].input > input {
padding-left: @iconMargin !important;
padding-right: @horizontalPadding !important;
.ui.ui[class*="left icon"].input > textarea,
.ui.ui[class*="left icon"].input > input {
padding-left: @iconMargin;
padding-right: @horizontalPadding;
}

/* Focus */
Expand Down Expand Up @@ -395,6 +398,9 @@
.ui.icon.input > textarea ~ .icon {
height: @textareaIconHeight;
}
:not(.field) > .ui.transparent.icon.input > textarea ~ .icon {
height: @transparentTextareaIconHeight;
}

/* Corner Label Position */
.ui.input > .ui.corner.label {
Expand Down
1 change: 1 addition & 0 deletions src/themes/default/elements/input.variables
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
@transparentIconMargin: 2em;

@textareaIconHeight: 3em;
@transparentTextareaIconHeight: 1.3em;

/* Circular Icon Input */
@circularIconVerticalOffset: 0.35em;
Expand Down

0 comments on commit dd561b5

Please sign in to comment.