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