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