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