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