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