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

Commit 7e9c9d3

Browse files
author
Dom Harrington
committed
Bringing in css from separate file in packages/api-explorer
1 parent 4df75f5 commit 7e9c9d3

File tree

5 files changed

+234
-371
lines changed

5 files changed

+234
-371
lines changed

example/index.html

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

example/src/Demo.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const createDocs = require('../../packages/api-explorer/lib/create-docs');
88
const ApiExplorer = require('../../packages/api-explorer/src');
99
const ApiList = require('./ApiList');
1010

11+
require('../../packages/api-explorer/api-explorer.css');
12+
1113
class Demo extends React.Component {
1214
constructor(props) {
1315
super(props);

0 commit comments

Comments
 (0)