]> BookStack Code Mirror - bookstack/blob - resources/assets/sass/_forms.scss
Rolled tri-layout to page edit and book-create
[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: #999;
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   display: inline-block;
143   background-color: #BBB;
144   width: 36px;
145   height: 14px;
146   border-radius: 7px;
147   position: relative;
148   transition: all ease-in-out 120ms;
149   cursor: pointer;
150   user-select: none;
151   &:after {
152     content: '';
153     display: block;
154     position: relative;
155     left: 0;
156     margin-top: -3px;
157     width: 20px;
158     height: 20px;
159     border-radius: 50%;
160     background-color: #fafafa;
161     border: 1px solid #CCC;
162     box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
163     transition: all ease-in-out 120ms;
164   }
165   &.active {
166     background-color: rgba($positive, 0.4);
167     &:after {
168       left: 16px;
169       background-color: $positive;
170       border: darken($positive, 20%);
171     }
172   }
173 }
174 .toggle-switch-checkbox {
175   display: none;
176 }
177 input:checked + .toggle-switch {
178   background-color: rgba($positive, 0.4);
179   &:after {
180     left: 16px;
181     background-color: $positive;
182     border: darken($positive, 20%);
183   }
184 }
185
186 .form-group {
187   margin-bottom: $-s;
188   textarea {
189     display: block;
190     width: 100%;
191     min-height: 64px;
192   }
193 }
194
195 .simple-code-input {
196   background-color: #F8F8F8;
197   font-family: monospace;
198   font-size: 12px;
199   min-height: 100px;
200 }
201
202 .form-group {
203   .text-pos, .text-neg {
204     padding: $-xs 0;
205   }
206 }
207
208 .form-group[collapsible] {
209   padding: 0 $-m;
210   border: 1px solid #DDD;
211   border-radius: 4px;
212   .collapse-title {
213     margin-left: -$-m;
214     margin-right: -$-m;
215     padding: $-s $-m;
216   }
217   .collapse-title, .collapse-title label {
218     cursor: pointer;
219   }
220   .collapse-title label {
221     padding-bottom: 0;
222     margin-bottom: 0;
223     color: inherit;
224   }
225   .collapse-title label:before {
226     display: inline-block;
227     content: '▸';
228     margin-right: $-m;
229     transition: all ease-in-out 400ms;
230     transform: rotate(0);
231   }
232   .collapse-content {
233     display: none;
234     padding-bottom: $-m;
235   }
236   &.open .collapse-title label:before {
237     transform: rotate(90deg);
238   }
239 }
240
241 .inline-input-style {
242   display: block;
243   width: 100%;
244   padding: $-s;
245 }
246
247 .title-input input[type="text"] {
248   @extend .inline-input-style;
249   margin-top: 0;
250   font-size: 2em;
251 }
252
253 .title-input.page-title {
254   font-size: 0.8em;
255   .input {
256     border: 0;
257     margin-bottom: -1px;
258   }
259   input[type="text"] {
260     max-width: 840px;
261     margin: 0 auto;
262     border: none;
263   }
264 }
265
266 .page-title input {
267   display: block;
268   width: 100%;
269   font-size: 1.4em;
270 }
271
272 .description-input textarea {
273   @extend .inline-input-style;
274   font-size: $fs-m;
275   color: #666;
276   width: 100%;
277 }
278
279 div[editor-type="markdown"] .title-input.page-title input[type="text"] {
280   max-width: 100%;
281 }
282
283 .search-box {
284   max-width: 100%;
285   position: relative;
286   button {
287     background-color: transparent;
288     border: none;
289     color: $primary;
290     padding: 0;
291     cursor: pointer;
292     position: absolute;
293     left: 8px;
294     top: 9.5px;
295   }
296   input {
297     display: block;
298     padding-left: $-l;
299     width: 300px;
300     max-width: 100%;
301   }
302 }
303
304 .outline > input {
305   border: 0;
306   border-bottom: 2px solid #DDD;
307   border-radius: 0;
308   &:focus, &:active {
309     border: 0;
310     border-bottom: 2px solid #AAA;
311     outline: 0;
312   }
313 }
314
315 #login-form label[for="remember"] {
316   margin: 0;
317 }
318 #login-form label.toggle-switch {
319   margin-left: $-xl;
320 }
321
322 .image-picker img {
323   background-color: #BBB;
324 }