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