UNPKG

3.48 kBtext/lessView Raw
1@import (reference) './imports/global';
2
3/**
4 * Quick search for header
5 */
6.aui-header .aui-quicksearch {
7 //
8 // Variables
9 //
10 @bg-color: var(--aui-appheader-quicksearch-bg-color);
11 @border-color: var(--aui-appheader-quicksearch-border-color);
12 @text-color: var(--aui-appheader-quicksearch-text-color);
13 @placeholder-color: var(--aui-appheader-quicksearch-placeholder-text-color);
14 @focus-bg-color: var(--aui-appheader-quicksearch-focus-bg-color);
15 @focus-text-color: var(--aui-appheader-quicksearch-focus-text-color);
16 @width: 170px;
17 @border-radius: 3px;
18 @box-shadow: none;
19 @icon: @aui-glyph-search-small;
20
21 @icon-height: @aui-icon-size-small;
22 @icon-width: @aui-icon-size-small;
23
24 @padding-left-right: @aui-grid;
25 @icon-gutter: 30px;
26 // this fudging number pushes the text slightly higher so it "lines up" with the text in menu items and buttons.
27 // it's 1px too low in Chrome, and 1px too high in Firefox and IE11. A compromise, if you will.
28 @text-baseline-fudge: 1px;
29
30 //
31 // Layout concerns:
32 // The container needs to be relative so we can absolutely position the icon within it.
33 // We use flexbox so that vertical alignment is handled by the browser rather than magic margin numbers.
34 //
35 display: flex;
36 justify-content: flex-end; // push to the RHS of the container.
37 align-items: center; // vertically center the elements.
38 position: relative;
39 margin: 0;
40
41 // ...and some cosmestic stuff.
42 color: @text-color;
43
44 input {
45 background: @bg-color;
46 border: @aui-form-field-border-width solid @border-color;
47 border-radius: @border-radius;
48 box-shadow: none;
49 box-sizing: border-box;
50 color: @text-color;
51 height: unit(30 / @aui-font-size-medium, em); // 30px effective - need height in ems so that user-specified font-sizes apply
52 font-family: inherit;
53 font-size: @aui-font-size-medium;
54 padding: 0 @padding-left-right 0 @icon-gutter;
55 vertical-align: baseline;
56 width: @width;
57
58 &::placeholder {
59 color: @placeholder-color;
60 }
61 }
62
63 // Override the browser appearance of type=text, type=search and type=button.
64 input[type] {
65 appearance: none;
66 }
67
68 input::-webkit-search-cancel-button {
69 appearance: none;
70 }
71
72 // icon
73 &::before {
74 #aui.icon-pseudoelement(@aui-icon-font-family);
75
76 // Layout concerns:
77 // because of a flexbox parent + align-self, there's no need to
78 // mess with margins or positioning relative to the top of the container; it's just done by flexbox :D
79 align-self: center;
80 pointer-events: none; // so the icon isn't clickable, so clicks on it will focus the input field
81 position: absolute;
82 left: (@icon-gutter - @icon-width) / 2; // sneakily shift the icon inside the input field
83
84 // And now the actual icon concerns:
85 content: @icon;
86 color: @placeholder-color;
87 font-size: @aui-icon-size-small;
88 line-height: 1;
89 height: @icon-height;
90 width: @icon-width;
91 z-index: 1;
92 }
93
94 &:focus-within::before {
95 color: @text-color;
96 }
97
98 input {
99 &:focus {
100 #aui.with-focus-border();
101
102 background: @focus-bg-color;
103 color: @focus-text-color;
104 }
105 }
106
107 &:focus-within::after {
108 color: @focus-text-color;
109 }
110}