]> BookStack Code Mirror - bookstack/blob - resources/sass/_forms.scss
Removed parallel testing, updated predis
[bookstack] / resources / sass / _forms.scss
1
2 .input-base {
3   border-radius: 3px;
4   border: 1px solid #D4D4D4;
5   @include lightDark(background-color, #fff, #333);
6   @include lightDark(border-color, #d4d4d4, #111);
7   @include lightDark(color, #666, #AAA);
8   display: inline-block;
9   font-size: $fs-m;
10   padding: $-xs*1.8;
11   height: 40px;
12   width: 250px;
13   max-width: 100%;
14
15   &.neg, &.invalid {
16     border: 1px solid $negative;
17   }
18   &.pos, &.valid {
19     border: 1px solid $positive;
20   }
21   &.disabled, &[disabled] {
22     background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAMUlEQVQIW2NkwAGuXbv2nxGbHEhCS0uLEUMSJgHShCKJLIEiiS4Bl8QmAZbEJQGSBAC62BuJ+tt7zgAAAABJRU5ErkJggg==);
23   }
24   &[readonly] {
25     background-color: #f8f8f8;
26   }
27   &:focus {
28     border-color: var(--color-primary);
29     outline: 1px solid var(--color-primary);
30   }
31 }
32
33 .input-fill-width {
34   width: 100% !important;
35 }
36
37 .fake-input {
38   @extend .input-base;
39   overflow: auto;
40 }
41
42 #html-editor {
43   display: none;
44 }
45
46 #markdown-editor {
47   position: relative;
48   z-index: 5;
49   #markdown-editor-input {
50     font-style: normal;
51     font-weight: 400;
52     padding: $-xs $-m;
53     color: #444;
54     border-radius: 0;
55     max-height: 100%;
56     flex: 1;
57     border: 0;
58     width: 100%;
59     &:focus {
60       outline: 0;
61     }
62   }
63   &.fullscreen {
64     position: fixed;
65     top: 0;
66     left: 0;
67     height: 100%;
68     z-index: 2;
69   }
70 }
71
72 .markdown-editor-wrap {
73   border-top: 1px solid #DDD;
74   border-bottom: 1px solid #DDD;
75   @include lightDark(border-color, #ddd, #000);
76   position: relative;
77   flex: 1;
78 }
79 .markdown-editor-wrap + .markdown-editor-wrap {
80   flex-basis: 50%;
81   flex-shrink: 0;
82   flex-grow: 0;
83 }
84
85 .markdown-panel-divider {
86   width: 2px;
87   @include lightDark(background-color, #ddd, #000);
88   cursor: col-resize;
89 }
90
91 @include smaller-than($m) {
92   #markdown-editor {
93     flex-direction: column;
94   }
95   #markdown-editor .markdown-editor-wrap {
96     width: 100%;
97     max-width: 100%;
98     flex-grow: 1;
99     flex-basis: auto !important;
100   }
101   .editor-toolbar-label {
102     float: none !important;
103     @include lightDark(border-color, #DDD, #555);
104     display: block;
105   }
106   .markdown-editor-wrap:not(.active) .editor-toolbar + div,
107   .markdown-editor-wrap:not(.active) .editor-toolbar .buttons,
108   .markdown-editor-wrap:not(.active) .markdown-display {
109     display: none;
110   }
111   #markdown-editor .markdown-editor-wrap:not(.active) {
112     flex-grow: 0;
113     flex: none;
114     min-height: 0;
115   }
116 }
117
118 .markdown-editor-display {
119   background-color: #fff;
120   body {
121     display: block;
122     background-color: #fff;
123     padding-inline-start: 16px;
124     padding-inline-end: 16px;
125   }
126   [drawio-diagram]:hover {
127     outline: 2px solid var(--color-primary);
128   }
129 }
130
131 html.markdown-editor-display.dark-mode {
132   background-color: #222;
133   body {
134     background-color: #222;
135   }
136 }
137
138 .editor-toolbar {
139   height: 32px;
140   width: 100%;
141   font-size: 11px;
142   line-height: 1.6;
143   border-bottom: 1px solid #DDD;
144   background-color: #EEE;
145   @include lightDark(background-color, #eee, #111);
146   @include lightDark(border-color, #ddd, #000);
147   flex: none;
148   @include whenDark {
149     button {
150       color: #AAA;
151     }
152   }
153 }
154
155 .editor-toolbar .buttons {
156   font-size: $fs-m;
157   .dropdown-menu {
158     padding: 0;
159   }
160   .toggle-switch {
161     margin: $-s 0;
162   }
163 }
164
165 .editor-toolbar .buttons button {
166   font-size: .9rem;
167   width: 2rem;
168   text-align: center;
169   border-left: 1px solid;
170   @include lightDark(border-color, #DDD, #555);
171   svg {
172     margin-inline-end: 0;
173   }
174   &:hover {
175     @include lightDark(background-color, #DDD, #222);
176   }
177 }
178
179
180 label {
181   @include lightDark(color, #666, #ddd);
182   display: block;
183   line-height: 1.4em;
184   font-size: 0.94em;
185   font-weight: 400;
186   padding-bottom: 2px;
187   margin-bottom: 0.2em;
188   &.inline {
189     display: inline-block;
190   }
191 }
192
193 label.radio, label.checkbox {
194   font-weight: 400;
195   user-select: none;
196   input[type="radio"], input[type="checkbox"] {
197     margin-inline-end: $-xs;
198   }
199 }
200
201 label.inline.checkbox {
202   margin-inline-end: $-m;
203 }
204
205 label + p.small {
206   margin-bottom: 0.8em;
207 }
208
209 table.form-table {
210   max-width: 100%;
211   td {
212     overflow: hidden;
213     padding: math.div($-xxs, 2) 0;
214   }
215 }
216
217 input[type="text"], input[type="number"], input[type="email"], input[type="date"], input[type="search"], input[type="url"],
218 input[type="color"], input[type="password"], select, textarea {
219   @extend .input-base;
220 }
221
222 select {
223   -webkit-appearance: none;
224   -moz-appearance: none;
225   appearance: none;
226   background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23666666'><polygon points='0,0 100,0 50,50'/></svg>");
227   background-size: 10px 12px;
228   background-position: calc(100% - 20px) 64%;
229   background-repeat: no-repeat;
230
231   @include rtl {
232     background-position: 20px 70%;
233   }
234 }
235
236 input[type=date] {
237   width: 190px;
238 }
239
240 input[type=color] {
241   height: 60px;
242   &.small {
243     height: 42px;
244     width: 60px;
245     padding: 2px;
246   }
247 }
248
249 .toggle-switch {
250   user-select: none;
251   display: inline-grid;
252   grid-template-columns: (16px + $-s) 1fr;
253   align-items: center;
254   margin: $-m 0;
255   .custom-checkbox {
256     width: 16px;
257     height: 16px;
258     border-radius: 2px;
259     display: inline-block;
260     border: 2px solid currentColor;
261     overflow: hidden;
262     fill: currentColor;
263     .svg-icon {
264       width: 100%;
265       height: 100%;
266       margin: 0;
267       bottom: auto;
268       top: -1.5px;
269       left: 0;
270       transition: transform ease-in-out 120ms;
271       transform: scale(0);
272       transform-origin: center center;
273     }
274   }
275   input[type=checkbox] {
276     display: none;
277   }
278   input[type=checkbox]:checked + .custom-checkbox .svg-icon {
279     transform: scale(1);
280   }
281   .custom-checkbox:hover {
282     background-color: rgba(0, 0, 0, 0.05);
283     opacity: 0.8;
284   }
285   input[type=checkbox][disabled] ~ * {
286     opacity: 0.8;
287     cursor: not-allowed;
288   }
289   input[type=checkbox][disabled] ~ .custom-checkbox {
290     border-color: #999;
291     color: #999 !important;
292     background: #f2f2f2;
293   }
294 }
295 .toggle-switch-list {
296   .toggle-switch {
297     margin: $-xs 0;
298   }
299   &.compact .toggle-switch {
300     margin: 1px 0;
301   }
302 }
303
304 .form-group {
305   margin-bottom: $-s;
306 }
307
308 .setting-list > div {
309   border-bottom: 1px solid #DDD;
310   padding: $-xl 0;
311   &:last-child {
312     border-bottom: none;
313   }
314 }
315 .setting-list-label {
316   color: #222;
317   font-size: 1rem;
318 }
319 .setting-list-label + p.small {
320   margin-bottom: 0;
321 }
322 .setting-list-label + .grid {
323   margin-top: $-m;
324 }
325
326 .setting-list .grid, .stretch-inputs {
327   input[type=text], input[type=email], input[type=password], select {
328     width: 100%;
329   }
330 }
331
332 .simple-code-input {
333   background-color: #F8F8F8;
334   font-family: monospace;
335   font-size: 12px;
336   min-height: 100px;
337   display: block;
338   width: 100%;
339 }
340
341 .form-group {
342   div.text-pos, div.text-neg, p.text-post, p.text-neg {
343     padding: $-xs 0;
344   }
345 }
346
347 .form-group.collapsible {
348   padding: 0 $-m;
349   border: 1px solid;
350   @include lightDark(border-color, #DDD, #000);
351   border-radius: 4px;
352   .collapse-title {
353     margin-inline-start: -$-m;
354     margin-inline-end: -$-m;
355     padding: $-s $-m;
356     display: block;
357     width: calc(100% + 32px);
358     text-align: start;
359   }
360   .collapse-title, .collapse-title label {
361     cursor: pointer;
362   }
363   .collapse-title label {
364     padding-bottom: 0;
365     margin-bottom: 0;
366     color: inherit;
367   }
368   .collapse-title label:before {
369     display: inline-block;
370     content: '▸';
371     margin-inline-end: $-m;
372     transition: all ease-in-out 400ms;
373     transform: rotate(0);
374   }
375   .collapse-content {
376     display: none;
377     padding-bottom: $-m;
378   }
379   &.open .collapse-title label:before {
380     transform: rotate(90deg);
381   }
382 }
383
384 .title-input input[type="text"] {
385   display: block;
386   width: 100%;
387   padding: $-s;
388   margin-top: 0;
389   font-size: 2em;
390   height: auto;
391 }
392
393 .title-input.page-title {
394   font-size: 0.8em;
395   @include lightDark(background-color, #fff, #333);
396   .input {
397     border: 0;
398     margin-bottom: -1px;
399   }
400   input[type="text"] {
401     max-width: 840px;
402     margin: 0 auto;
403     border: none;
404     height: auto;
405   }
406 }
407
408 .page-title input {
409   display: block;
410   width: 100%;
411   font-size: 1.4em;
412 }
413
414 .description-input textarea {
415   display: block;
416   width: 100%;
417   padding: $-s;
418   font-size: $fs-m;
419   color: #666;
420   height: auto;
421 }
422
423 div[editor-type="markdown"] .title-input.page-title input[type="text"] {
424   max-width: 100%;
425   border-radius: 0;
426 }
427
428 .search-box {
429   max-width: 100%;
430   position: relative;
431   button[tabindex="-1"] {
432     background-color: transparent;
433     border: none;
434     @include lightDark(color, #666, #AAA);
435     padding: 0;
436     cursor: pointer;
437     position: absolute;
438     left: 8px;
439     top: 9px;
440     @include rtl {
441       right: 8px;
442       left: auto;
443     }
444   }
445   input {
446     display: block;
447     padding: $-xs * 1.5;
448     padding-inline-start: $-l + 4px;
449     width: 300px;
450     max-width: 100%;
451     height: auto;
452   }
453   &.flexible input {
454     width: 100%;
455   }
456   .search-box-cancel {
457     left: auto;
458     right: 0;
459   }
460 }
461
462 .outline > input {
463   border: 0;
464   border-bottom: 2px solid #DDD;
465   border-radius: 0;
466   &:focus, &:active {
467     border: 0;
468     border-bottom: 2px solid #AAA;
469     outline: 0;
470   }
471 }
472
473
474 .image-picker img {
475   background-color: #BBB;
476   max-width: 100%;
477 }
478
479 .custom-file-input {
480   overflow: hidden;
481   padding: 0;
482   position: absolute;
483   white-space: nowrap;
484   width: 1px;
485   height: 1px;
486   border: 0;
487   clip: rect(0, 0, 0, 0);
488 }
489 .custom-file-input:focus + label {
490   border-color: var(--color-primary);
491   outline: 1px solid var(--color-primary);
492 }
493
494 input.shortcut-input {
495   width: auto;
496   max-width: 120px;
497   height: auto;
498 }