source: pro-violet-viettel/www/deploy/20150304/assets/css/less/searchbox.less @ 896

Last change on this file since 896 was 780, checked in by dungnv, 10 years ago
File size: 3.8 KB
Line 
1//some searchbox variables
2@search-border:#6FB3E0;
3@search-color:#666;
4@search-color-focus:#656A72;
5
6@search-width:152px;
7@sb-search-width:162px;
8@search-border-radius:4px;
9
10
11
12/* searchbox */
13.nav-search {
14  position:absolute;
15  top:6px; right:22px;
16  line-height:24px;
17
18  .form-search {
19        margin-bottom:0;
20  }
21
22 .nav-search-input {
23        border:1px solid @search-border;
24
25        width:@search-width;
26        height:28px !important;
27        .border-radius(@search-border-radius) !important;
28
29        font-size:13px;
30        color:@search-color !important;
31        z-index:11;
32
33
34        .transition(~"width ease .15s");
35
36        & + .dropdown-menu { /* the typeahead menu*/
37         min-width:0;
38         left:0; right:0;
39        }
40
41        &:focus , &:hover{
42                border-color:@search-border;
43        }
44
45 }
46 
47 
48 //.nav-search-btn {
49//      border-radius:0;
50// }
51
52 .nav-search-icon {
53        color:@search-border !important;
54        font-size:14px !important;
55        line-height:24px !important;
56 }
57
58
59   
60 &.minimized {
61        .nav_search_minimized()
62 }
63}
64
65
66
67.nav_search_minimized() {
68        .nav-search-input {
69                width:0;
70                .opacity(0);
71                max-width:0; // for safari only
72        }
73         
74        &:hover .nav-search-input ,
75        .nav-search-btn:active + .nav-search-input ,
76        .nav-search-input:focus, .nav-search-input:hover, .nav-search-input:active
77        {
78                .opacity(1);
79                width:@search-width;
80                max-width:@search-width; // for safari only
81        }
82
83        .nav-search-icon {
84                border:1px solid;
85                border-radius:100%;
86
87                background-color:#FFF;
88
89                padding:0 5px !important;
90        }
91       
92        &:hover .nav-search-icon ,
93        .nav-search-input:focus ~ .nav-search-icon,
94        .nav-search-input:hover ~ .nav-search-icon,
95        .nav-search-input:active ~ .nav-search-icon
96        {
97                border:none;
98                border-radius:0;
99                padding:0 3px !important;
100        }
101}
102
103
104.nav_search_icon_active() {
105        border:none;
106        border-radius:0;
107        padding:0 3px !important;
108}
109
110.nav-search-icon {
111        .nav_search_icon_active();
112}
113
114/* nav-search inside sidebar */
115.sidebar > .nav-search  {
116   position:static;
117
118   background-color:#FAFAFA;
119   border-bottom:1px solid #DDD;
120   text-align:center;
121
122   height:35px;
123   padding-top:6px;
124
125
126   .nav-search-input {
127         width:@sb-search-width !important;
128         border-radius:0 !important;
129         max-width:@sb-search-width !important;
130         .opacity(1) !important;
131         
132         & + .dropdown-menu { text-align:left; }
133   }
134
135}//nav-search inside sidebar
136
137 
138  /* sidebar when minimized */
139.searchbox_inside_min_menu() {
140  .nav-search {
141        .form-search {
142                position:absolute; left:5px;
143                z-index:14;
144        }
145       
146        .nav_search_input_active() {
147                width:@sb-search-width !important;
148                max-width:@sb-search-width !important;
149                .opacity(1) !important;
150        }
151        .nav-search-input {
152                width:0 !important;
153                max-width:0 !important;
154                .opacity(0) !important;
155               
156                &:hover, &:focus, &:active {
157                        .nav_search_input_active();
158                         ~ #nav-search-icon {
159                                .nav_search_icon_active();
160                         }
161                }
162        }
163       
164        &:hover .nav-search-input {
165                .nav_search_input_active();
166                ~ .nav-search-icon {
167                        .nav_search_icon_active();
168                }
169        }
170       
171        .nav-search-icon {/* inside minimized sidebar */
172                border:1px solid;
173                border-radius:32px;
174
175                background-color:#FFF;
176                padding:0 5px !important;
177        }
178  }
179}
180
181
182
183.sidebar.menu-min {
184        .searchbox_inside_min_menu();
185}
186/**
187@media only screen and (max-width: 979px) {
188  .sidebar.responsive-min {
189        .searchbox_inside_min_menu();
190  }
191}
192*/
193
194
195
196
197
198
199
200/* responsive searchbox */
201@media only screen and (max-width: @screen-xs-max) {
202        .nav-search {
203                right:5px;
204        }
205        .nav-search .nav-search-input {
206                width:105px;
207        }
208        .nav-search:hover .nav-search-input ,
209        .nav-search  .nav-search-btn:active + .nav-search-input ,
210        .nav-search  .nav-search-input:focus, .nav-search  .nav-search-input:hover, .nav-search  .nav-search-input:active
211        {
212                width:145px;
213        }
214}
215@media only screen and (max-width: @screen-xs) {
216        .nav-search {
217                .nav_search_minimized()
218        }
219}
Note: See TracBrowser for help on using the repository browser.