]> BookStack Code Mirror - bookstack/blob - resources/assets/sass/_forms.scss
Started the migration of the setting views
[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   user-select: none;
143   display: inline-grid;
144   grid-template-columns: (16px + $-s) 1fr;
145   align-items: center;
146   margin: $-m 0;
147   .custom-checkbox {
148     width: 16px;
149     height: 16px;
150     border-radius: 2px;
151     display: inline-block;
152     border: 2px solid #999;
153     overflow: hidden;
154     fill: #888;
155     .svg-icon {
156       width: 100%;
157       height: 100%;
158       margin: 0;
159       bottom: auto;
160       top: -1.5px;
161       left: 0;
162       transition: transform ease-in-out 120ms;
163       transform: scale(0);
164       transform-origin: center center;
165     }
166   }
167   input[type=checkbox] {
168     display: none;
169   }
170   input[type=checkbox]:checked + .custom-checkbox .svg-icon {
171     transform: scale(1);
172   }
173   .custom-checkbox:hover {
174     background-color: rgba(0, 0, 0, 0.05);
175   }
176 }
177
178 .form-group {
179   margin-bottom: $-s;
180 }
181
182 .setting-list > div {
183   border-bottom: 1px solid #DDD;
184   padding: $-xl 0;
185   &:last-child {
186     border-bottom: none;
187   }
188 }
189 .setting-list-label {
190   color: #444;
191   font-size: 1rem;
192 }
193 .setting-list-label + p.small {
194   margin-bottom: 0;
195 }
196
197 .simple-code-input {
198   background-color: #F8F8F8;
199   font-family: monospace;
200   font-size: 12px;
201   min-height: 100px;
202   display: block;
203   width: 100%;
204 }
205
206 .form-group {
207   .text-pos, .text-neg {
208     padding: $-xs 0;
209   }
210 }
211
212 .form-group[collapsible] {
213   padding: 0 $-m;
214   border: 1px solid #DDD;
215   border-radius: 4px;
216   .collapse-title {
217     margin-left: -$-m;
218     margin-right: -$-m;
219     padding: $-s $-m;
220   }
221   .collapse-title, .collapse-title label {
222     cursor: pointer;
223   }
224   .collapse-title label {
225     padding-bottom: 0;
226     margin-bottom: 0;
227     color: inherit;
228   }
229   .collapse-title label:before {
230     display: inline-block;
231     content: '▸';
232     margin-right: $-m;
233     transition: all ease-in-out 400ms;
234     transform: rotate(0);
235   }
236   .collapse-content {
237     display: none;
238     padding-bottom: $-m;
239   }
240   &.open .collapse-title label:before {
241     transform: rotate(90deg);
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 }