Skip to content

Commit

Permalink
Fix #382 Typeahead display when using 16px vs 14px
Browse files Browse the repository at this point in the history
  • Loading branch information
running-coder committed Oct 9, 2017
1 parent 05b7c74 commit 014640b
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 101 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.scss]
indent_size = 4
indent_style = space
2 changes: 1 addition & 1 deletion dist/jquery.typeahead.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"babel-core": "6.4.5",
"babel-preset-es2015": "6.3.13",
"gulp": "git://github.com/gulpjs/gulp.git#4.0",
"gulp-autoprefixer": "3.1.0",
"gulp-autoprefixer": "4.0.0",
"gulp-cssnano": "^2.1.0",
"gulp-jshint": "^2.0.1",
"gulp-rename": "1.2.2",
Expand Down
84 changes: 42 additions & 42 deletions src/jquery.typeahead.css
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,14 @@
/* 2 */
}

html,
body {
font-size: 16px;
}

.typeahead__container {
position: relative;
font: 14px Lato, "Helvetica Neue", Arial, Helvetica, sans-serif;
font: 1rem Lato, "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.typeahead__container * {
Expand Down Expand Up @@ -207,29 +212,13 @@
}

.typeahead__field {
font-size: 0;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
position: relative;
display: table;
border-collapse: collapse;
width: 100%;
}

.typeahead__field > * {
display: table-cell;
vertical-align: top;
}

.typeahead__query, .typeahead__filter, .typeahead__button {
font-size: 14px;
}

.typeahead__button {
position: relative;
font-size: 0;
width: 1%;
vertical-align: top;
}

.typeahead__button button {
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
Expand All @@ -245,9 +234,9 @@
.typeahead__field .typeahead__hint {
display: block;
width: 100%;
min-height: 36px;
line-height: 1.6;
padding: 6px 12px;
line-height: 1.25;
min-height: calc(1.25rem + (0.5rem * 2));
padding: 0.5rem 0.75rem;
background: #fff;
border: 1px solid #ccc;
border-radius: 2px 0 0 2px;
Expand Down Expand Up @@ -298,8 +287,8 @@
cursor: pointer;
background-color: #fff;
border: 1px solid #ccc;
height: 36px;
padding: 6px 12px;
line-height: 1.25;
padding: 0.5rem 0.75rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -415,7 +404,7 @@
.typeahead__list > li > a,
.typeahead__dropdown > li > a {
display: block;
padding: 6px 12px;
padding: 0.5rem 0.75rem;
clear: both;
color: #333;
text-decoration: none;
Expand All @@ -432,7 +421,7 @@
}

.typeahead__list.empty > li {
padding: 6px 12px;
padding: 0.5rem 0.75rem;
color: #333;
}

Expand Down Expand Up @@ -486,10 +475,8 @@
position: absolute;
right: 0;
cursor: pointer;
font-size: 18px;
line-height: 1.25;
height: 36px;
padding: 6px 10px;
padding: 0.5rem 0.75rem;
visibility: hidden;
}

Expand All @@ -510,25 +497,23 @@
padding: 0 1.25rem;
width: 16px;
height: 16px;
text-align: center;
display: inline-block;
background: url(data:image/svg+xml;charset=utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMS4xLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDI1MC4zMTMgMjUwLjMxMyIgc3R5b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L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=) no-repeat scroll center center transparent;
}

.typeahead__container.loading .typeahead__query:before, .typeahead__container.loading .typeahead__query:after {
transition: all 0s linear, opacity 0.2s ease;
position: absolute;
z-index: 3;
content: '';
content: "";
top: 50%;
right: .55em;
right: 0.55em;
margin-top: -10.5px;
width: 21px;
height: 21px;
box-sizing: border-box;
border-radius: 500rem;
border-style: solid;
border-width: .1em;
border-width: 0.1em;
}

.typeahead__container.loading .typeahead__query:before {
Expand Down Expand Up @@ -569,33 +554,48 @@
.typeahead__label-container {
list-style: none;
position: absolute;
padding-top: 6px;
padding-top: calc(1rem * 0.375);
padding-left: 6px;
width: 100%;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

.typeahead__label {
font-size: 12px;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
font-size: calc(1rem * 0.875);
position: relative;
display: inline-block;
background: #ecf5fc;
border: solid 1px #c2e0ff;
padding-left: 4px;
border-radius: 2px;
margin-right: 4px;
margin-bottom: 6px;
margin-bottom: calc(1rem * 0.375);
}

.typeahead__label > * {
display: inline-block;
-webkit-align-self: center;
-ms-flex-item-align: center;
-ms-grid-row-align: center;
align-self: center;
}

.typeahead__label .typeahead__cancel-button {
line-height: normal;
height: auto;
position: static;
padding: 4px 6px;
padding-top: calc(1rem * 0.215 - 1px);
padding-bottom: calc(1rem * 0.215 + 1px);
padding-left: 6px;
padding-right: 6px;
margin-left: 4px;
font-size: 12px;
font-size: calc(1rem * 0.875);
border-left: solid 1px #c2e0ff;
}

Expand Down
Loading

0 comments on commit 014640b

Please sign in to comment.