graphiql-base.css 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. /* GraphiQL Base styles from https://github.com/graphql/graphiql/blob/main/packages/graphiql/src/style.css */
  2. /* Everything */
  3. .graphiql-container {
  4. background-color: hsl(var(--color-base));
  5. display: flex;
  6. height: 100%;
  7. margin: 0;
  8. overflow: hidden;
  9. width: 100%;
  10. }
  11. /* The sidebar */
  12. .graphiql-container .graphiql-sidebar {
  13. display: flex;
  14. flex-direction: column;
  15. justify-content: space-between;
  16. padding: var(--px-8);
  17. width: var(--sidebar-width);
  18. }
  19. .graphiql-container .graphiql-sidebar .graphiql-sidebar-section {
  20. display: flex;
  21. flex-direction: column;
  22. gap: var(--px-8);
  23. }
  24. .graphiql-container .graphiql-sidebar button {
  25. display: flex;
  26. align-items: center;
  27. justify-content: center;
  28. color: hsla(var(--color-neutral), var(--alpha-secondary));
  29. height: calc(var(--sidebar-width) - (2 * var(--px-8)));
  30. width: calc(var(--sidebar-width) - (2 * var(--px-8)));
  31. }
  32. .graphiql-container .graphiql-sidebar button.active {
  33. color: hsla(var(--color-neutral), 1);
  34. }
  35. .graphiql-container .graphiql-sidebar button:not(:first-child) {
  36. margin-top: var(--px-4);
  37. }
  38. .graphiql-container .graphiql-sidebar button > svg {
  39. height: var(--px-20);
  40. width: var(--px-20);
  41. }
  42. /* The main content, i.e. everything except the sidebar */
  43. .graphiql-container .graphiql-main {
  44. display: flex;
  45. flex: 1;
  46. min-width: 0;
  47. }
  48. /* The current session and tabs */
  49. .graphiql-container .graphiql-sessions {
  50. background-color: hsla(var(--color-neutral), var(--alpha-background-light));
  51. /* Adding the 8px of padding to the inner border radius of the query editor */
  52. border-radius: calc(var(--border-radius-12) + var(--px-8));
  53. display: flex;
  54. flex-direction: column;
  55. flex: 1;
  56. max-height: 100%;
  57. margin: var(--px-16);
  58. margin-left: 0;
  59. min-width: 0;
  60. }
  61. /* The session header containing tabs and the logo */
  62. .graphiql-container .graphiql-session-header {
  63. align-items: center;
  64. display: flex;
  65. justify-content: space-between;
  66. height: var(--session-header-height);
  67. }
  68. /* The button to add a new tab */
  69. button.graphiql-tab-add {
  70. height: 100%;
  71. padding: var(--px-4);
  72. }
  73. button.graphiql-tab-add > svg {
  74. color: hsla(var(--color-neutral), var(--alpha-secondary));
  75. display: block;
  76. height: var(--px-16);
  77. width: var(--px-16);
  78. }
  79. /* The right-hand-side of the session header */
  80. .graphiql-container .graphiql-session-header-right {
  81. align-items: center;
  82. display: flex;
  83. }
  84. /* The GraphiQL logo */
  85. .graphiql-container .graphiql-logo {
  86. color: hsla(var(--color-neutral), var(--alpha-secondary));
  87. font-size: var(--font-size-h4);
  88. font-weight: var(--font-weight-medium);
  89. padding: var(--px-12) var(--px-16);
  90. }
  91. /* Undo default link styling for the default GraphiQL logo link */
  92. .graphiql-container .graphiql-logo .graphiql-logo-link {
  93. color: hsla(var(--color-neutral), var(--alpha-secondary));
  94. text-decoration: none;
  95. }
  96. /* The editor of the session */
  97. .graphiql-container .graphiql-session {
  98. display: flex;
  99. flex: 1;
  100. padding: 0 var(--px-8) var(--px-8);
  101. }
  102. /* All editors (query, variable, headers) */
  103. .graphiql-container .graphiql-editors {
  104. background-color: hsl(var(--color-base));
  105. border-radius: calc(var(--border-radius-12));
  106. box-shadow: var(--popover-box-shadow);
  107. display: flex;
  108. flex: 1;
  109. flex-direction: column;
  110. }
  111. .graphiql-container .graphiql-editors.full-height {
  112. margin-top: calc(var(--px-8) - var(--session-header-height));
  113. }
  114. /* The query editor and the toolbar */
  115. .graphiql-container .graphiql-query-editor {
  116. border-bottom: 1px solid hsla(var(--color-neutral), var(--alpha-background-heavy));
  117. padding: var(--px-16);
  118. column-gap: var(--px-16);
  119. display: flex;
  120. width: 100%;
  121. }
  122. /* The vertical toolbar next to the query editor */
  123. .graphiql-container .graphiql-toolbar {
  124. width: var(--toolbar-width);
  125. }
  126. .graphiql-container .graphiql-toolbar > * + * {
  127. margin-top: var(--px-8);
  128. }
  129. /* The toolbar icons */
  130. .graphiql-toolbar-icon {
  131. color: hsla(var(--color-neutral), var(--alpha-tertiary));
  132. display: block;
  133. height: calc(var(--toolbar-width) - (var(--px-8) * 2));
  134. width: calc(var(--toolbar-width) - (var(--px-8) * 2));
  135. }
  136. /* The tab bar for editor tools */
  137. .graphiql-container .graphiql-editor-tools {
  138. cursor: row-resize;
  139. display: flex;
  140. width: 100%;
  141. column-gap: var(--px-8);
  142. padding: var(--px-8);
  143. }
  144. .graphiql-container .graphiql-editor-tools button {
  145. color: hsla(var(--color-neutral), var(--alpha-secondary));
  146. }
  147. .graphiql-container .graphiql-editor-tools button.active {
  148. color: hsla(var(--color-neutral), 1);
  149. }
  150. /* The tab buttons to switch between editor tools */
  151. .graphiql-container .graphiql-editor-tools > button:not(.graphiql-toggle-editor-tools) {
  152. padding: var(--px-8) var(--px-12);
  153. }
  154. .graphiql-container .graphiql-editor-tools .graphiql-toggle-editor-tools {
  155. margin-left: auto;
  156. }
  157. /* An editor tool, e.g. variable or header editor */
  158. .graphiql-container .graphiql-editor-tool {
  159. flex: 1;
  160. padding: var(--px-16);
  161. }
  162. /**
  163. * The way CodeMirror editors are styled they overflow their containing
  164. * element. For some OS-browser-combinations this might cause overlap issues,
  165. * setting the position of this to `relative` makes sure this element will
  166. * always be on top of any editors.
  167. */
  168. .graphiql-container .graphiql-toolbar,
  169. .graphiql-container .graphiql-editor-tools,
  170. .graphiql-container .graphiql-editor-tool {
  171. position: relative;
  172. }
  173. /* The response view */
  174. .graphiql-container .graphiql-response {
  175. --editor-background: transparent;
  176. display: flex;
  177. width: 100%;
  178. flex-direction: column;
  179. }
  180. /* The results editor wrapping container */
  181. .graphiql-container .graphiql-response .result-window {
  182. position: relative;
  183. flex: 1;
  184. }
  185. /* The footer below the response view */
  186. .graphiql-container .graphiql-footer {
  187. border-top: 1px solid hsla(var(--color-neutral), var(--alpha-background-heavy));
  188. }
  189. /* The plugin container */
  190. .graphiql-container .graphiql-plugin {
  191. border-left: 1px solid hsla(var(--color-neutral), var(--alpha-background-heavy));
  192. flex: 1;
  193. overflow-y: auto;
  194. padding: var(--px-16);
  195. }
  196. /* Generic drag bar for horizontal resizing */
  197. .graphiql-horizontal-drag-bar {
  198. width: var(--px-12);
  199. cursor: col-resize;
  200. }
  201. .graphiql-horizontal-drag-bar:hover::after {
  202. border: var(--px-2) solid hsla(var(--color-neutral), var(--alpha-background-heavy));
  203. border-radius: var(--border-radius-2);
  204. content: '';
  205. display: block;
  206. height: 25%;
  207. margin: 0 auto;
  208. position: relative;
  209. /* (100% - 25%) / 2 = 37.5% */
  210. top: 37.5%;
  211. width: 0;
  212. }
  213. .graphiql-container .graphiql-chevron-icon {
  214. color: hsla(var(--color-neutral), var(--alpha-tertiary));
  215. display: block;
  216. height: var(--px-12);
  217. margin: var(--px-12);
  218. width: var(--px-12);
  219. }
  220. /* Generic spin animation */
  221. .graphiql-spin {
  222. animation: spin 0.8s linear 0s infinite;
  223. }
  224. @keyframes spin {
  225. from {
  226. transform: rotate(0deg);
  227. }
  228. to {
  229. transform: rotate(360deg);
  230. }
  231. }
  232. /* The header of the settings dialog */
  233. .graphiql-dialog .graphiql-dialog-header {
  234. align-items: center;
  235. display: flex;
  236. justify-content: space-between;
  237. padding: var(--px-24);
  238. }
  239. /* The title of the settings dialog */
  240. .graphiql-dialog .graphiql-dialog-title {
  241. font-size: var(--font-size-h3);
  242. font-weight: var(--font-weight-medium);
  243. margin: 0;
  244. }
  245. /* A section inside the settings dialog */
  246. .graphiql-dialog .graphiql-dialog-section {
  247. align-items: center;
  248. border-top: 1px solid hsla(var(--color-neutral), var(--alpha-background-heavy));
  249. display: flex;
  250. justify-content: space-between;
  251. padding: var(--px-24);
  252. }
  253. .graphiql-dialog .graphiql-dialog-section > :not(:first-child) {
  254. margin-left: var(--px-24);
  255. }
  256. /* The section title in the settings dialog */
  257. .graphiql-dialog .graphiql-dialog-section-title {
  258. font-size: var(--font-size-h4);
  259. font-weight: var(--font-weight-medium);
  260. }
  261. /* The section caption in the settings dialog */
  262. .graphiql-dialog .graphiql-dialog-section-caption {
  263. color: hsla(var(--color-neutral), var(--alpha-secondary));
  264. }
  265. .graphiql-dialog .graphiql-warning-text {
  266. color: hsl(var(--color-warning));
  267. font-weight: var(--font-weight-medium);
  268. }
  269. .graphiql-dialog .graphiql-table {
  270. border-collapse: collapse;
  271. width: 100%;
  272. }
  273. .graphiql-dialog .graphiql-table :is(th, td) {
  274. border: 1px solid hsla(var(--color-neutral), var(--alpha-background-heavy));
  275. padding: var(--px-8) var(--px-12);
  276. }
  277. /* A single key the short-key dialog */
  278. .graphiql-dialog .graphiql-key {
  279. background-color: hsla(var(--color-neutral), var(--alpha-background-medium));
  280. border-radius: var(--border-radius-4);
  281. padding: var(--px-4);
  282. }
  283. /* Avoid showing native tooltips for icons with titles */
  284. .graphiql-container svg {
  285. pointer-events: none;
  286. }