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