-
Notifications
You must be signed in to change notification settings - Fork 50
/
typeahead.less
154 lines (144 loc) · 3.97 KB
/
typeahead.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
* typehead.js-bootstrap3.less
* @version 0.2.3
* https://github.com/hyspace/typeahead.js-bootstrap3.less
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
//custom mixin for .form-control-validation
.typeahead-form-control(@border-color: #ccc;) {
border-color: @border-color;
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
&:focus {
border-color: darken(@border-color, 10%);
@shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
.box-shadow(@shadow);
}
}
//main styles for control
.tt-input,
.tt-hint {
.twitter-typeahead &{
//validation states
.has-warning &{
.typeahead-form-control(@state-warning-text);
}
.has-error &{
.typeahead-form-control(@state-danger-text);
}
.has-success &{
.typeahead-form-control(@state-success-text);
}
}
//border
.input-group .twitter-typeahead:first-child &{
.border-left-radius(@border-radius-base);
width: 100%;
}
.input-group .twitter-typeahead:last-child &{
.border-right-radius(@border-radius-base);
width: 100%;
}
//sizing - small:size and border
.input-group.input-group-sm .twitter-typeahead &{
.input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
}
.input-group.input-group-sm .twitter-typeahead:not(:first-child):not(:last-child) &{
border-radius: 0;
}
.input-group.input-group-sm .twitter-typeahead:first-child &{
.border-left-radius(@border-radius-small);
.border-right-radius(0);
}
.input-group.input-group-sm .twitter-typeahead:last-child &{
.border-left-radius(0);
.border-right-radius(@border-radius-small);
}
//sizing - large:size and border
.input-group.input-group-lg .twitter-typeahead &{
.input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
}
.input-group.input-group-lg .twitter-typeahead:not(:first-child):not(:last-child) &{
border-radius: 0;
}
.input-group.input-group-lg .twitter-typeahead:first-child &{
.border-left-radius(@border-radius-large);
.border-right-radius(0);
}
.input-group.input-group-lg .twitter-typeahead:last-child &{
.border-left-radius(0);
.border-right-radius(@border-radius-large);
}
}
//for wrapper
.twitter-typeahead {
width: 100%;
float: left;
.input-group &{
//overwrite `display:inline-block` style
display: table-cell!important;
}
}
//particular style for each other
.twitter-typeahead .tt-hint {
color: @text-muted;//color - hint
}
.twitter-typeahead .tt-input {
z-index: 2;
//disabled status
//overwrite inline styles of .tt-query
&[disabled],
&[readonly],
fieldset[disabled] & {
cursor: not-allowed;
//overwirte inline style
background-color: @input-bg-disabled!important;
}
}
//dropdown styles
.tt-dropdown-menu, .tt-menu {
//dropdown menu
position: absolute;
top: 100%;
left: 0;
z-index: @zindex-dropdown;
min-width: 160px;
width: 100%;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: @font-size-base;
background-color: @dropdown-bg;
border: 1px solid @dropdown-fallback-border;
border: 1px solid @dropdown-border;
border-radius: @border-radius-base;
.box-shadow(0 6px 12px rgba(0,0,0,.175));
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
.tt-suggestion {
//item
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: @line-height-base;
color: @dropdown-link-color;
&.tt-cursor, &:hover {
//item selected
cursor: pointer;
text-decoration: none;
outline: 0;
background-color: @dropdown-link-hover-bg;
color: @dropdown-link-hover-color;
a {
//link in item selected
color: @dropdown-link-hover-color;
}
}
p {
margin: 0;
}
}
}