UNPKG

4.31 kBSCSSView Raw
1$color-primary: #007bff;
2$color-disabled: #495057;
3$color-white: #fff;
4
5// Hide IE's native "clear" button
6.rbt .rbt-input-main::-ms-clear {
7 display: none;
8}
9
10/**
11 * Menu
12 */
13.rbt-menu {
14 margin-bottom: 2px; // Spacing for dropup
15
16 & > .dropdown-item {
17 overflow: hidden;
18 text-overflow: ellipsis;
19
20 &:focus {
21 outline: none;
22 }
23 }
24
25 &-pagination-option {
26 text-align: center;
27 }
28}
29
30/**
31 * Multi-select Input
32 */
33$background-color-disabled: #e9ecef;
34
35$border-color-focus: #80bdff;
36$border-color-focus-invalid: #dc3545;
37$border-color-focus-valid: #28a745;
38
39$box-shadow-dimensions: 0 0 0 0.2rem;
40$box-shadow-color: rgba(0, 123, 255, 0.25);
41$box-shadow-color-invalid: rgba(220, 53, 69, 0.25);
42$box-shadow-color-valid: rgba(40, 167, 69, 0.25);
43
44$color-focus: #495057;
45$placeholder-color: #6c757d;
46
47.rbt-input-multi {
48 cursor: text;
49 overflow: hidden;
50 position: relative;
51
52 // Apply Bootstrap focus styles
53 &.focus {
54 border-color: $border-color-focus;
55 box-shadow: $box-shadow-dimensions $box-shadow-color;
56 color: $color-focus;
57 outline: 0;
58 }
59
60 &.form-control {
61 height: auto;
62 }
63
64 // BS4 uses the :disabled pseudo-class, which doesn't work with non-inputs.
65 &.form-control[disabled] {
66 background-color: $background-color-disabled;
67 opacity: 1;
68 }
69
70 &.is-invalid.focus {
71 border-color: $border-color-focus-invalid;
72 box-shadow: $box-shadow-dimensions $box-shadow-color-invalid;
73 }
74
75 &.is-valid.focus {
76 border-color: $border-color-focus-valid;
77 box-shadow: $box-shadow-dimensions $box-shadow-color-valid;
78 }
79
80 // Apply Bootstrap placeholder styles
81 input {
82 // Firefox
83 &::-moz-placeholder {
84 color: $placeholder-color;
85 opacity: 1;
86 }
87
88 // Internet Explorer 10+
89 &:-ms-input-placeholder {
90 color: $placeholder-color;
91 }
92
93 // Safari and Chrome
94 &::-webkit-input-placeholder {
95 color: $placeholder-color;
96 }
97 }
98
99 .rbt-input-wrapper {
100 align-items: flex-start;
101 display: flex;
102 flex-wrap: wrap;
103 margin-bottom: -4px;
104 margin-top: -1px;
105 overflow: hidden;
106 }
107
108 .rbt-input-main {
109 margin: 1px 0 4px;
110 }
111}
112
113/**
114 * Close Button
115 */
116.rbt-close {
117 z-index: 1;
118
119 &-lg {
120 font-size: 24px;
121 }
122}
123
124/**
125 * Token
126 */
127$token-background-color: #e7f4ff;
128$token-color: $color-primary;
129
130$token-disabled-background-color: rgba(0, 0, 0, 0.1);
131$token-disabled-color: $color-disabled;
132
133$token-active-background-color: $color-primary;
134$token-active-color: $color-white;
135
136.rbt-token {
137 background-color: $token-background-color;
138 border: 0;
139 border-radius: .25rem;
140 color: $token-color;
141 display: inline-block;
142 line-height: 1em;
143 margin: 1px 3px 2px 0;
144 padding: 4px 7px;
145 position: relative;
146
147 &-disabled {
148 background-color: $token-disabled-background-color;
149 color: $token-disabled-color;
150 pointer-events: none;
151 }
152
153 &-removeable {
154 cursor: pointer;
155 padding-right: 21px;
156 }
157
158 &-active {
159 background-color: $token-active-background-color;
160 color: $token-active-color;
161 outline: none;
162 text-decoration: none;
163 }
164
165 & &-remove-button {
166 bottom: 0;
167 color: inherit;
168 font-size: inherit;
169 font-weight: normal;
170 opacity: 1;
171 outline: none;
172 padding: 3px 7px;
173 position: absolute;
174 right: 0;
175 text-shadow: none;
176 top: -2px;
177 }
178}
179
180/**
181 * Loader + CloseButton container
182 */
183.rbt-aux {
184 align-items: center;
185 display: flex;
186 bottom: 0;
187 justify-content: center;
188 pointer-events: none; /* Don't block clicks on the input */
189 position: absolute;
190 right: 0;
191 top: 0;
192 width: 34px;
193
194 &-lg {
195 width: 46px;
196 }
197
198 & .rbt-close {
199 margin-top: -4px;
200 pointer-events: auto; /* Override pointer-events: none; above */
201 }
202}
203
204.has-aux .rbt-input {
205 padding-right: 34px;
206}
207
208
209// Default highlight style
210.rbt-highlight-text {
211 background-color: inherit;
212 color: inherit;
213 font-weight: bold;
214 padding: 0;
215}
216
217/**
218 * Input Groups
219 */
220.input-group > .rbt {
221 flex: 1;
222
223 // Form-controls within input-groups have a higher z-index.
224 & .rbt-input-hint,
225 & .rbt-aux {
226 z-index: 5;
227 }
228
229 &:not(:first-child) .form-control {
230 border-top-left-radius: 0;
231 border-bottom-left-radius: 0;
232 }
233
234 &:not(:last-child) .form-control {
235 border-top-right-radius: 0;
236 border-bottom-right-radius: 0;
237 }
238}