Skip to content

Commit

Permalink
ensure same input heights in browsers; remove resetting of input clea…
Browse files Browse the repository at this point in the history
…r buttons and arrows (#96)
  • Loading branch information
htor authored Nov 19, 2019
1 parent 4085734 commit d21b1f2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
20 changes: 8 additions & 12 deletions lib/core-css.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ button, a { touch-action: manipulation }
font-family: inherit;
font-size: inherit;
line-height: 1.5; /* Makes input[type="file"] equal height as other inputs */
height: 2.6em; /* Makes all textual inputs same height. This and line-height is needed for that. */
box-shadow: 0 0 0 1px rgba(0,0,0,.15); /* IE11 doesn't render border on checkbox and radio */
border-radius: 4px;
padding: .5em .7em;
Expand All @@ -185,14 +186,10 @@ button, a { touch-action: manipulation }
.nrk-input:disabled { opacity: .5; cursor: not-allowed !important }
.nrk-input[readonly] { opacity: .8; cursor: default !important }

.nrk-input::-ms-clear, /* reset IE search clear */
.nrk-input::-ms-expand, /* reset IE select arrow */
.nrk-input::-ms-reveal, /* reset IE password reveal */
.nrk-input::-ms-check { /* reset IE checkbox check */
display: none;
}

.nrk-input[type="file"] { cursor: pointer }
.nrk-input::-ms-value { /* reset IE input[type="file"] text style */
background: none;
color: inherit;
Expand All @@ -202,13 +199,7 @@ button, a { touch-action: manipulation }
border: 0;
}

/* hides number arrows in FireFox */
.nrk-input[type="number"] { -moz-appearance: textfield }

/* hides number arrows in chrome, safari */
.nrk-input::-webkit-outer-spin-button,
.nrk-input::-webkit-inner-spin-button { -webkit-appearance: none }

.nrk-input[type="file"] { cursor: pointer }

.nrk-input[type="radio"] { border-radius: 100% }
.nrk-input[type="radio"],
Expand Down Expand Up @@ -251,13 +242,18 @@ the foreground and background color on the element */
}

textarea.nrk-input {
height: auto;
overflow: auto; /* Consistenly show scrollbar */
resize: vertical; /* Prevent horizontally resizable textarea */
vertical-align: top;
line-height: inherit;
}

select.nrk-input[multiple] { vertical-align: top }
select.nrk-input[multiple] {
height: auto;
vertical-align: top;
}

select.nrk-input:not([multiple]) {
background-image:
linear-gradient(45deg, transparent 46%, currentcolor 47%, currentcolor 49%, transparent 51%),
Expand Down
4 changes: 4 additions & 0 deletions lib/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ functional form layout.
Search
<input class="nrk-input nrk-xs-12of12" type="search" placeholder="Search">
</label>
<label class="nrk-xs-12of12 nrk-lg-4of12">
Time
<input class="nrk-input nrk-xs-12of12" type="time" placeholder="Time">
</label>
<label class="nrk-xs-12of12 nrk-lg-4of12">
Number
<input class="nrk-input nrk-xs-12of12" type="number" placeholder="Number">
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d21b1f2

Please sign in to comment.