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