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