]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/sass/bootstrap.scss
20eeeb62327225ef22e306dd056303ab29841b23
[github/Chocobozzz/PeerTube.git] / client / src / sass / bootstrap.scss
1 $icon-font-path: '~@neos21/bootstrap3-glyphicons/assets/fonts/';
2
3 @use '_variables' as *;
4 @use '_mixins' as *;
5
6 @import './_bootstrap-variables';
7
8 @import '~bootstrap/scss/functions';
9 @import '~bootstrap/scss/variables';
10 @import '~bootstrap/scss/mixins';
11 @import '~bootstrap/scss/utilities';
12
13 @import '~bootstrap/scss/root';
14 @import '~bootstrap/scss/reboot';
15 @import '~bootstrap/scss/type';
16 @import '~bootstrap/scss/grid';
17 @import '~bootstrap/scss/forms';
18 @import '~bootstrap/scss/buttons';
19 @import '~bootstrap/scss/dropdown';
20 @import '~bootstrap/scss/button-group';
21 @import '~bootstrap/scss/nav';
22 @import '~bootstrap/scss/card';
23 @import '~bootstrap/scss/accordion';
24 @import '~bootstrap/scss/alert';
25 @import '~bootstrap/scss/close';
26 @import '~bootstrap/scss/modal';
27 @import '~bootstrap/scss/tooltip';
28 @import '~bootstrap/scss/popover';
29
30 @import '~bootstrap/scss/helpers';
31 @import '~bootstrap/scss/utilities/api';
32
33 @import '~@neos21/bootstrap3-glyphicons/assets/stylesheets/bootstrap3-glyphicons';
34
35 // Thanks https://gist.github.com/alexandrevicenzi/680147013e902a4eaa5d
36 .glyphicon-refresh-animate {
37 animation: spin 0.7s infinite linear;
38 }
39
40 .flex-auto {
41 flex: auto;
42 }
43
44 .c-hand {
45 cursor: pointer !important;
46 }
47
48 @keyframes spin {
49 from {
50 transform: scale(1) rotate(0deg);
51 }
52
53 to {
54 transform: scale(1) rotate(360deg);
55 }
56 }
57
58 // ---------------------------------------------------------------------------
59 // Dropdown
60 // ---------------------------------------------------------------------------
61
62 .dropdown-menu {
63 font-size: 15px;
64 color: pvar(--mainForegroundColor);
65 background-color: pvar(--mainBackgroundColor);
66
67 .dropdown-header {
68 @include padding-left(1rem);
69 }
70
71 .dropdown-item {
72 padding: 3px 15px;
73
74 &.active {
75 color: pvar(--mainBackgroundColor) !important;
76 background-color: pvar(--mainHoverColor);
77 opacity: 0.9;
78 }
79
80 &::after {
81 display: none;
82 }
83 }
84
85 a {
86 @include disable-default-a-behaviour;
87 }
88 }
89
90 .dropdown-divider {
91 margin: 0.3rem 0;
92 }
93
94 // ---------------------------------------------------------------------------
95 // Modal
96 // ---------------------------------------------------------------------------
97
98 @media screen and (min-width: #{breakpoint(md)}) {
99 .modal::before {
100 vertical-align: middle;
101 content: ' ';
102 height: 100%;
103 }
104
105 .modal-dialog {
106 text-align: start;
107
108 &:not(.modal-lg):not(.modal-xl) {
109 min-width: 500px;
110 width: 40vw;
111 max-width: 900px;
112 }
113 }
114 }
115
116 .modal {
117 text-align: center;
118
119 .modal-content {
120 background-color: pvar(--mainBackgroundColor);
121 word-break: break-word;
122 }
123
124 .modal-header {
125 border-bottom: 0;
126 margin-bottom: 5px;
127
128 .modal-title {
129 font-size: 20px;
130 font-weight: $font-semibold;
131 }
132
133 my-global-icon {
134 @include icon(22px);
135
136 position: relative;
137 top: 5px;
138 float: right;
139
140 margin: 0;
141 padding: 0;
142 opacity: 0.5;
143
144 &[iconName=cross] { /* stylelint-disable-line selector-max-compound-selectors */
145 @include icon(16px);
146
147 top: -3px;
148 }
149 }
150 }
151
152 .inputs {
153 margin-bottom: 0;
154 text-align: end;
155
156 > *:not(:first-child) {
157 @include margin-left(10px);
158 }
159 }
160 }
161
162
163 // On desktop browsers, make the content and header horizontally sticked to right not move when modal open and close
164 .modal-open {
165 overflow-y: scroll !important; // Make sure vertical scroll bar is always visible on desktop browsers to get disabled scrollbar effect
166 width: 100vw; // Make sure the content fits all the available width
167 }
168
169 // On touchscreen devices, simply overflow: hidden to avoid detached overlay on scroll
170 @media (hover: none) and (pointer: coarse) {
171 .modal-open,
172 .menu-open {
173 overflow: hidden !important;
174 }
175
176 // On touchscreen devices display content overlay when opened menu
177 .menu-open {
178 .main-col {
179 &::before {
180 background-color: #000;
181 width: 100vw;
182 height: 100vh;
183 opacity: 0.75;
184 content: '';
185 display: block;
186 position: fixed;
187 z-index: z(overlay);
188 }
189 }
190 }
191 }
192
193 // ---------------------------------------------------------------------------
194 // Nav
195 // ---------------------------------------------------------------------------
196
197 .nav .nav-link {
198 display: flex !important;
199 align-items: center;
200 height: 30px !important;
201 padding: 10px 15px !important;
202 }
203
204 .nav.nav-pills {
205 font-size: 16px !important;
206 font-weight: $font-semibold !important;
207
208 .nav-link {
209 opacity: 0.6 !important;
210
211 &.active,
212 &:hover,
213 &:active,
214 &:focus {
215 opacity: 1 !important;
216 }
217 }
218
219 a {
220 @include disable-default-a-behaviour;
221
222 color: pvar(--mainForegroundColor);
223 }
224 }
225
226 .nav-tabs .nav-link {
227 @include disable-default-a-behaviour;
228
229 color: pvar(--mainForegroundColor);
230 font-weight: $font-semibold;
231 border: 0;
232 border-bottom: 2px solid transparent;
233 opacity: 0.6;
234
235 &.active {
236 color: pvar(--mainForegroundColor);
237 background-color: pvar(--mainBackgroundColor) !important;
238 border-bottom-color: pvar(--mainColor);
239 }
240
241 &.active,
242 &:hover,
243 &:active,
244 &:focus {
245 opacity: 1;
246 }
247 }
248
249 // ---------------------------------------------------------------------------
250 // Card, collapse and accordion
251 // ---------------------------------------------------------------------------
252
253 .card {
254 background-color: pvar(--mainBackgroundColor);
255 border-color: #dee2e6;
256 }
257
258 .collapse-transition {
259 // Animation when we show/hide the filters
260 transition: max-height 0.3s;
261 display: block !important;
262 overflow: hidden !important;
263 max-height: 0;
264
265 &.show {
266 max-height: 1500px;
267 overflow: inherit !important;
268 }
269 }
270
271 // ---------------------------------------------------------------------------
272 // Buttons & form controls
273 // ---------------------------------------------------------------------------
274
275 .btn-outline-secondary {
276 border-color: $input-border-color;
277
278 &:focus-within,
279 &:focus,
280 &:hover {
281 color: #fff;
282 background-color: #6c757d;
283 }
284 }
285
286 .btn-group.select-button {
287 font-weight: $font-semibold;
288
289 .active {
290 @include orange-button;
291 }
292
293 :not(.active) {
294 @include grey-button;
295 }
296
297 > * {
298 @include peertube-button-link;
299
300 box-shadow: none !important;
301
302 &:not(:first-child) {
303 border-top-left-radius: 0 !important;
304 border-bottom-left-radius: 0 !important;
305 }
306
307 &:not(:last-child) {
308 border-top-right-radius: 0 !important;
309 border-bottom-right-radius: 0 !important;
310 }
311 }
312 }
313
314 .form-control {
315 font-size: 15px;
316 color: pvar(--mainForegroundColor);
317 background-color: pvar(--inputBackgroundColor);
318 outline: none;
319
320 // Input box-shadow on focus
321 &:focus-within,
322 &:focus {
323 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
324
325 &.input-error {
326 box-shadow: #{$focus-box-shadow-form} #{scale-color($red, $alpha: -75%)};
327 }
328 }
329 }
330
331 .input-group {
332 > .btn,
333 > .input-group-text {
334 height: $button-height;
335 }
336
337 > .input-group-text {
338 font-size: 15px;
339 line-height: normal;
340 opacity: 0.9;
341 }
342
343 .input-group-text > .dropdown-toggle {
344 display: flex;
345 }
346
347 .last-in-group {
348 border-top-right-radius: 3px !important;
349 border-bottom-right-radius: 3px !important;
350 }
351 }
352
353 .has-clear {
354 position: relative;
355
356 input {
357 @include padding-right(1.5rem !important);
358 }
359
360 .form-control-clear {
361 color: rgba(0, 0, 0, 0.4);
362 display: flex;
363 justify-content: center;
364 align-items: center;
365 position: absolute;
366 right: .5rem;
367 height: 95%;
368 font-size: 14px;
369
370 &:hover {
371 color: rgba(0, 0, 0, 0.7);
372 cursor: pointer;
373 }
374 }
375
376 input:placeholder-shown + .form-control-clear {
377 display: none;
378 }
379 }