Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 06118d4

Browse files
author
Dom Harrington
committed
Whoops, forgot to add css file
1 parent 7e9c9d3 commit 06118d4

File tree

1 file changed

+368
-0
lines changed

1 file changed

+368
-0
lines changed
Lines changed: 368 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,368 @@
1+
/* Add margin to left- and right-sides of RJSF component. */
2+
form.rjsf {
3+
margin: 0% 3%;
4+
}
5+
6+
/* Remove borders surrounding params. */
7+
fieldset {
8+
border: none;
9+
}
10+
11+
/* Ensure nested objects retain full width. */
12+
fieldset fieldset {
13+
padding: 0;
14+
width: 100%;
15+
}
16+
17+
/* Remove margin from nested forms (for file uploads). */
18+
form form.rjsf {
19+
margin: 2% 2%;
20+
}
21+
22+
input[type='file'] {
23+
border: none !important;
24+
margin-left: 0px;
25+
padding: 10px;
26+
}
27+
28+
/* Style table header. */
29+
.param-type-header {
30+
color: #aeaeae;
31+
font-size: 14px;
32+
text-transform: uppercase;
33+
border-bottom: 1px solid #ddd;
34+
margin-left: 3%;
35+
}
36+
37+
/* Style param labels. */
38+
.form-group .control-label {
39+
font-weight: 400;
40+
text-align: left;
41+
min-width: 100px;
42+
padding-right: unset;
43+
float: left;
44+
font-weight: bold;
45+
flex: 1 1 150px;
46+
}
47+
48+
/* Style param category labels. */
49+
legend {
50+
font-weight: bold;
51+
margin: 10px 0px;
52+
}
53+
54+
/* Style input fields similar to current explorer. */
55+
input {
56+
border: 1px solid #eaeaea !important;
57+
border-radius: 2px;
58+
padding: 8px 10px;
59+
margin-left: 15px;
60+
}
61+
62+
/* Prevent input fields from becoming too wide. */
63+
.form-group .form-control {
64+
max-width: 250px;
65+
flex: 1 1 150px;
66+
}
67+
68+
/* Align nested input fields. */
69+
fieldset fieldset .form-group.field .field-description {
70+
margin-left: 1em;
71+
}
72+
73+
/* Add padding and top-border around nested form-groups. */
74+
.form-group .form-group {
75+
padding-top: 10px;
76+
padding-bottom: 10px;
77+
border-top: 1px solid #f2f2f2;
78+
}
79+
80+
/* Hide border for first form-group in an object. */
81+
fieldset .form-group:first-of-type {
82+
border-top: none;
83+
}
84+
85+
/* Render each object's param container as a flex object.
86+
Allows for better aligning of fields, labels, etc. */
87+
fieldset .form-group {
88+
display: flex;
89+
flex-flow: row nowrap;
90+
align-items: center;
91+
align-content: center;
92+
}
93+
94+
/* Parameters for nested objects should be indented. */
95+
fieldset fieldset {
96+
margin-left: 0%;
97+
}
98+
99+
/* Allow description to scale to 2x size of input field and
100+
param titles (some endpoints have lengthy descriptions.
101+
Also add styling. */
102+
.field-description {
103+
flex: 2 1 100px;
104+
text-align: left;
105+
font-size: 14px !important;
106+
font-weight: 300;
107+
margin-bottom: 0px;
108+
}
109+
110+
/* Add thick left border to nested params (show hierarchy). */
111+
fieldset fieldset .form-group {
112+
border-left: 10px solid #f2f2f2;
113+
}
114+
115+
/* Add margin to label for nested params. */
116+
fieldset fieldset .form-group label {
117+
margin-left: 1em;
118+
}
119+
120+
.form-group.field select {
121+
margin-left: 15px;
122+
}
123+
124+
/* Fix how booleans are displayed. */
125+
.checkbox {
126+
display: flex;
127+
flex-flow: row nowrap;
128+
justify-content: flex-start;
129+
align-items: center;
130+
align-content: space-around;
131+
}
132+
133+
.checkbox :nth-child(1) {
134+
order: 2;
135+
}
136+
137+
.checkbox :nth-child(2) {
138+
order: 1;
139+
}
140+
141+
.checkbox > .field-description {
142+
margin-left: 1em;
143+
}
144+
145+
.checkbox > label {
146+
font-size: 14px !important;
147+
font-weight: bold;
148+
}
149+
150+
.checkbox input[type='checkbox'] {
151+
margin-right: 1em;
152+
}
153+
154+
/* Style select boxes. */
155+
156+
.field .form-group select {
157+
border: 1px solid #eaeaea !important;
158+
border-radius: 2px;
159+
padding: 8px 10px;
160+
margin-left: 15px;
161+
height: 30px;
162+
}
163+
164+
/* Display arrays as flex containers, don't wrap, center-align vertically. */
165+
.array-item {
166+
display: flex;
167+
flex-wrap: nowrap;
168+
align-items: center;
169+
align-content: center;
170+
justify-content: flex-start;
171+
flex: 1 1 100%;
172+
}
173+
174+
/* Remove left- */
175+
.array-item .form-group.field {
176+
border-left: none;
177+
}
178+
179+
/* For each nested object in an array, add border. */
180+
.array-item fieldset {
181+
border-left: 10px solid #f2f2f2;
182+
background: rgba(244, 244, 244, 0.1);
183+
padding-left: 1em;
184+
padding-right: 1em;
185+
margin-left: 1em;
186+
}
187+
188+
/* For each nested object in an array, unset max-width for description. */
189+
.array-item fieldset .field-description {
190+
max-width: unset;
191+
text-align: left;
192+
}
193+
194+
/* For descriptions of arrays or nested objects, right-align and add padding above. */
195+
.field-array > legend {
196+
text-align: left;
197+
padding-top: 5px !important;
198+
}
199+
200+
/* Similarly as above, but for .field-description's instead of <legend>'s. */
201+
.field-array > .field-description {
202+
text-align: left;
203+
}
204+
205+
/* For arrays, override Bootstrap col-xs-9 properties. */
206+
.array-item .col-xs-9 {
207+
padding: 0px;
208+
flex-basis: auto;
209+
min-width: 200px;
210+
max-width: 90%;
211+
}
212+
213+
/* Ensure that nested arrays have full-width input fields. */
214+
.array-item .col-xs-9 .form-group .form-control {
215+
width: 100%;
216+
}
217+
218+
/* Remove left-margins from rows that are offset with Bootstrap's grid system. */
219+
.row .col-xs-offset-9 {
220+
margin-left: 0px;
221+
}
222+
223+
/* Override Bootstrap properties for "add" button (for arrays). */
224+
.array-item-add.col-xs-3 {
225+
flex-basis: unset;
226+
max-width: unset;
227+
margin-top: 10px;
228+
}
229+
230+
/* For up/down/remove toolbox for items in arrays, change default size. */
231+
.array-item-toolbox.col-xs-3 {
232+
flex-basis: 12%;
233+
}
234+
235+
/* Align up/down/remove toolbox to the right. */
236+
.array-item-toolbox .btn-group {
237+
justify-content: flex-start;
238+
}
239+
240+
/* Reset padding and remove border + other styles from buttons in up/down/remove toolbox. */
241+
.array-item-toolbox button {
242+
padding-left: 8px;
243+
padding-right: 8px;
244+
border: none;
245+
width: 30px !important;
246+
height: 30px !important;
247+
flex: unset !important;
248+
}
249+
250+
.btn:active {
251+
box-shadow: none;
252+
}
253+
254+
.btn:focus {
255+
outline: none;
256+
}
257+
258+
.btn.btn-default {
259+
border: none;
260+
}
261+
262+
.btn.btn-default:hover {
263+
border: none;
264+
}
265+
266+
.btn.btn-add::after {
267+
content: '+';
268+
}
269+
270+
.btn.array-item-move-up::after {
271+
content: '↑';
272+
}
273+
274+
/*TODO fix this?*/
275+
.btn.array-item-move-up[disabled]::after {
276+
font-weight: lighter;
277+
}
278+
279+
.btn.array-item-move-down::after {
280+
content: '↓';
281+
}
282+
283+
/*TODO fix this?*/
284+
.btn.array-item-move-down[disabled] {
285+
font-weight: lighter;
286+
}
287+
288+
.btn.array-item-remove::after {
289+
content: '✕';
290+
}
291+
292+
button[disabled] {
293+
color: #d2d2d2 !important;
294+
}
295+
296+
.field.field-array-of-string legend::after {
297+
content: 'array of strings';
298+
background: #f2f2f2;
299+
border-radius: 3px;
300+
font-family: monospace;
301+
font-size: 11px;
302+
font-weight: lighter;
303+
margin-left: 10px;
304+
padding: 3px;
305+
}
306+
307+
.field.field-array-of-integer legend::after {
308+
content: 'array of integers';
309+
background: #f2f2f2;
310+
border-radius: 3px;
311+
font-family: monospace;
312+
font-size: 11px;
313+
font-weight: lighter;
314+
margin-left: 10px;
315+
padding: 3px;
316+
}
317+
318+
.field.field-array-of-object legend::after {
319+
content: 'array of objects';
320+
background: #f2f2f2;
321+
border-radius: 3px;
322+
font-family: monospace;
323+
font-size: 11px;
324+
font-weight: lighter;
325+
margin-left: 10px;
326+
padding: 3px;
327+
}
328+
329+
330+
.field.field-integer label::after {
331+
content: 'integer';
332+
background: #f2f2f2;
333+
border-radius: 3px;
334+
font-family: monospace;
335+
font-size: 11px;
336+
font-weight: lighter;
337+
margin-left: 10px;
338+
padding: 3px;
339+
}
340+
341+
.field.field-string label::after {
342+
content: 'string';
343+
background: #f2f2f2;
344+
border-radius: 3px;
345+
font-family: monospace;
346+
font-size: 11px;
347+
font-weight: lighter;
348+
margin-left: 10px;
349+
padding: 3px;
350+
}
351+
352+
.field.field-boolean label::after {
353+
content: 'boolean';
354+
background: #f2f2f2;
355+
border-radius: 3px;
356+
font-family: monospace;
357+
font-size: 11px;
358+
font-weight: lighter;
359+
margin-left: 10px;
360+
padding: 3px;
361+
}
362+
/*TODO fix this*/
363+
/*.array-item .field-string::before {
364+
content: 'string';
365+
font-weight: lighter;
366+
float: right;
367+
margin-right: 3%;
368+
}*/

0 commit comments

Comments
 (0)