]> BookStack Code Mirror - bookstack/blob - resources/assets/sass/_forms.scss
Added experimental breadcrumb traversal
[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 {
180   .toggle-switch {
181     margin: $-xs 0;
182   }
183   &.compact .toggle-switch {
184     margin: 1px 0;
185   }
186 }
187
188 .form-group {
189   margin-bottom: $-s;
190 }
191
192 .setting-list > div {
193   border-bottom: 1px solid #DDD;
194   padding: $-xl 0;
195   &:last-child {
196     border-bottom: none;
197   }
198 }
199 .setting-list-label {
200   color: #444;
201   font-size: 1rem;
202 }
203 .setting-list-label + p.small {
204   margin-bottom: 0;
205 }
206 .setting-list-label + .grid {
207   margin-top: $-m;
208 }
209
210 .setting-list .grid, .stretch-inputs {
211   input[type=text], input[type=email], input[type=password], select {
212     width: 100%;
213   }
214 }
215
216 .simple-code-input {
217   background-color: #F8F8F8;
218   font-family: monospace;
219   font-size: 12px;
220   min-height: 100px;
221   display: block;
222   width: 100%;
223 }
224
225 .form-group {
226   .text-pos, .text-neg {
227     padding: $-xs 0;
228   }
229 }
230
231 .form-group[collapsible] {
232   padding: 0 $-m;
233   border: 1px solid #DDD;
234   border-radius: 4px;
235   .collapse-title {
236     margin-left: -$-m;
237     margin-right: -$-m;
238     padding: $-s $-m;
239   }
240   .collapse-title, .collapse-title label {
241     cursor: pointer;
242   }
243   .collapse-title label {
244     padding-bottom: 0;
245     margin-bottom: 0;
246     color: inherit;
247   }
248   .collapse-title label:before {
249     display: inline-block;
250     content: '▸';
251     margin-right: $-m;
252     transition: all ease-in-out 400ms;
253     transform: rotate(0);
254   }
255   .collapse-content {
256     display: none;
257     padding-bottom: $-m;
258   }
259   &.open .collapse-title label:before {
260     transform: rotate(90deg);
261   }
262 }
263
264 .inline-input-style {
265   display: block;
266   width: 100%;
267   padding: $-s;
268 }
269
270 .title-input input[type="text"] {
271   @extend .inline-input-style;
272   margin-top: 0;
273   font-size: 2em;
274 }
275
276 .title-input.page-title {
277   font-size: 0.8em;
278   .input {
279     border: 0;
280     margin-bottom: -1px;
281   }
282   input[type="text"] {
283     max-width: 840px;
284     margin: 0 auto;
285     border: none;
286   }
287 }
288
289 .page-title input {
290   display: block;
291   width: 100%;
292   font-size: 1.4em;
293 }
294
295 .description-input textarea {
296   @extend .inline-input-style;
297   font-size: $fs-m;
298   color: #666;
299   width: 100%;
300 }
301
302 div[editor-type="markdown"] .title-input.page-title input[type="text"] {
303   max-width: 100%;
304 }
305
306 .search-box {
307   max-width: 100%;
308   position: relative;
309   button {
310     background-color: transparent;
311     border: none;
312     color: $primary;
313     padding: 0;
314     cursor: pointer;
315     position: absolute;
316     left: 8px;
317     top: 9.5px;
318   }
319   input {
320     display: block;
321     padding-left: $-l;
322     width: 300px;
323     max-width: 100%;
324   }
325 }
326
327 .outline > input {
328   border: 0;
329   border-bottom: 2px solid #DDD;
330   border-radius: 0;
331   &:focus, &:active {
332     border: 0;
333     border-bottom: 2px solid #AAA;
334     outline: 0;
335   }
336 }
337
338 .image-picker img {
339   background-color: #BBB;
340 }