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