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