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