]> BookStack Code Mirror - bookstack/blob - resources/sass/_forms.scss
French translation update
[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 }
176
177 .toggle-switch {
178   user-select: none;
179   display: inline-grid;
180   grid-template-columns: (16px + $-s) 1fr;
181   align-items: center;
182   margin: $-m 0;
183   .custom-checkbox {
184     width: 16px;
185     height: 16px;
186     border-radius: 2px;
187     display: inline-block;
188     border: 2px solid currentColor;
189     opacity: 0.6;
190     overflow: hidden;
191     fill: currentColor;
192     .svg-icon {
193       width: 100%;
194       height: 100%;
195       margin: 0;
196       bottom: auto;
197       top: -1.5px;
198       left: 0;
199       transition: transform ease-in-out 120ms;
200       transform: scale(0);
201       transform-origin: center center;
202     }
203   }
204   input[type=checkbox] {
205     display: none;
206   }
207   input[type=checkbox]:checked + .custom-checkbox .svg-icon {
208     transform: scale(1);
209   }
210   .custom-checkbox:hover {
211     background-color: rgba(0, 0, 0, 0.05);
212     opacity: 0.8;
213   }
214 }
215 .toggle-switch-list {
216   .toggle-switch {
217     margin: $-xs 0;
218   }
219   &.compact .toggle-switch {
220     margin: 1px 0;
221   }
222 }
223
224 .form-group {
225   margin-bottom: $-s;
226 }
227
228 .setting-list > div {
229   border-bottom: 1px solid #DDD;
230   padding: $-xl 0;
231   &:last-child {
232     border-bottom: none;
233   }
234 }
235 .setting-list-label {
236   color: #222;
237   font-size: 1rem;
238 }
239 .setting-list-label + p.small {
240   margin-bottom: 0;
241 }
242 .setting-list-label + .grid {
243   margin-top: $-m;
244 }
245
246 .setting-list .grid, .stretch-inputs {
247   input[type=text], input[type=email], input[type=password], select {
248     width: 100%;
249   }
250 }
251
252 .simple-code-input {
253   background-color: #F8F8F8;
254   font-family: monospace;
255   font-size: 12px;
256   min-height: 100px;
257   display: block;
258   width: 100%;
259 }
260
261 .form-group {
262   div.text-pos, div.text-neg, p.text-post, p.text-neg {
263     padding: $-xs 0;
264   }
265 }
266
267 .form-group[collapsible] {
268   padding: 0 $-m;
269   border: 1px solid #DDD;
270   border-radius: 4px;
271   .collapse-title {
272     margin-left: -$-m;
273     margin-right: -$-m;
274     padding: $-s $-m;
275     display: block;
276     width: calc(100% + 32px);
277     text-align: left;
278   }
279   .collapse-title, .collapse-title label {
280     cursor: pointer;
281   }
282   .collapse-title label {
283     padding-bottom: 0;
284     margin-bottom: 0;
285     color: inherit;
286   }
287   .collapse-title label:before {
288     display: inline-block;
289     content: '▸';
290     margin-right: $-m;
291     transition: all ease-in-out 400ms;
292     transform: rotate(0);
293   }
294   .collapse-content {
295     display: none;
296     padding-bottom: $-m;
297   }
298   &.open .collapse-title label:before {
299     transform: rotate(90deg);
300   }
301 }
302
303 .inline-input-style {
304   display: block;
305   width: 100%;
306   padding: $-s;
307 }
308
309 .title-input input[type="text"] {
310   @extend .inline-input-style;
311   margin-top: 0;
312   font-size: 2em;
313 }
314
315 .title-input.page-title {
316   font-size: 0.8em;
317   .input {
318     border: 0;
319     margin-bottom: -1px;
320   }
321   input[type="text"] {
322     max-width: 840px;
323     margin: 0 auto;
324     border: none;
325   }
326 }
327
328 .page-title input {
329   display: block;
330   width: 100%;
331   font-size: 1.4em;
332 }
333
334 .description-input textarea {
335   @extend .inline-input-style;
336   font-size: $fs-m;
337   color: #666;
338   width: 100%;
339 }
340
341 div[editor-type="markdown"] .title-input.page-title input[type="text"] {
342   max-width: 100%;
343 }
344
345 .search-box {
346   max-width: 100%;
347   position: relative;
348   button {
349     background-color: transparent;
350     border: none;
351     fill: #666;
352     padding: 0;
353     cursor: pointer;
354     position: absolute;
355     left: 8px;
356     top: 9px;
357   }
358   input {
359     display: block;
360     padding-left: $-l + 4px;
361     width: 300px;
362     max-width: 100%;
363   }
364   &.flexible input {
365     width: 100%;
366   }
367   .search-box-cancel {
368     left: auto;
369     right: 0;
370   }
371 }
372
373 .outline > input {
374   border: 0;
375   border-bottom: 2px solid #DDD;
376   border-radius: 0;
377   &:focus, &:active {
378     border: 0;
379     border-bottom: 2px solid #AAA;
380     outline: 0;
381   }
382 }
383
384
385 .image-picker img {
386   background-color: #BBB;
387   max-width: 100%;
388 }
389
390 .custom-file-input {
391   overflow: hidden;
392   padding: 0;
393   position: absolute;
394   white-space: nowrap;
395   width: 1px;
396   height: 1px;
397   border: 0;
398   clip: rect(0, 0, 0, 0);
399 }
400 .custom-file-input:focus + label {
401   border-color: var(--color-primary);
402   outline: 1px solid var(--color-primary);
403 }