You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Read the rationale on the OneGraph blog](https://www.onegraph.com/blog/2019/01/24/How_OneGraph_onboards_users_new_to_GraphQL.html).
19
+
20
+
21
+
## Customizing styles
22
+
23
+
The default styling matches for the Explorer matches the default styling for GraphiQL. If you've customized your GraphiQL styling, you can customize the Explorer's styling to match.
24
+
25
+
### Customizing colors
26
+
27
+
The Explorer accepts a `colors` prop as a map of the class names in GraphiQL's css to hex colors. If you've edited the GraphiQL class names that control colors (e.g. `cm-def`, `cm-variable`, `cm-string`, etc.) use those same colors in the colors map. The naming of the keys in the colors map tries to align closely with the names of the class names in GraphiQL's css (note that the Explorer can't just apply the classes because of conflicts with how the css file styles inputs).
28
+
29
+
Example style map:
30
+
31
+
```javascript
32
+
<Explorer colors={{
33
+
keyword:'#B11A04',
34
+
// OperationName, FragmentName
35
+
def:'#D2054E',
36
+
// FieldName
37
+
property:'#1F61A0',
38
+
// FieldAlias
39
+
qualifier:'#1C92A9',
40
+
// ArgumentName and ObjectFieldName
41
+
attribute:'#8B2BB9',
42
+
number:'#2882F9',
43
+
string:'#D64292',
44
+
// Boolean
45
+
builtin:'#D47509',
46
+
// Enum
47
+
string2:'#0B7FC7',
48
+
variable:'#397D13',
49
+
// Type
50
+
atom:'#CA9800',
51
+
}} />
52
+
```
53
+
54
+
### Customizing arrows and checkboxes
55
+
56
+
The explorer accepts props for setting custom checkboxes (for leaf fields) and arrows (for object fields).
57
+
58
+
The props are `arrowOpen`, `arrowClosed`, `checkboxChecked`, and `checkboxUnchecked`. You can pass any react node for those props.
0 commit comments