@createiq/swagger-ui-scss 5.30.3 → 5.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@createiq/swagger-ui-scss",
3
- "version": "5.30.3",
3
+ "version": "5.31.0",
4
4
  "main": "./style/main.scss",
5
5
  "homepage": "https://github.com/swagger-api/swagger-ui",
6
6
  "repository": {
@@ -0,0 +1,664 @@
1
+ @use "sass:list";
2
+
3
+ // Variables for consistent theme
4
+ $neutral-10: #F0F1F1;
5
+ $neutral-20: #E4E6E6;
6
+ $neutral-30: #D2D6D7;
7
+ $neutral-40: #B7BCBF;
8
+ $neutral-50: #8C969A;
9
+ $neutral-60: #6B757A;
10
+ $neutral-80: #545D61;
11
+ $neutral-85: #434B4F;
12
+ $neutral-95: #2A2E30;
13
+ $neutral-98: #1C2022;
14
+ $neutral-100: #080A0B;
15
+
16
+ $success-30: #4AC966;
17
+ $error-30: #FF5F5F;
18
+
19
+ $authorize-button: #3ECE90;
20
+ $link: #51A8FF;
21
+ $markdown-code: #B68AE1;
22
+ $textarea: #0D1014;
23
+ $textarea-disabled: #202225;
24
+ $info-version-stamp: #1D632E;
25
+ $curl-command-button: #3B424D;
26
+ $curl-command-button-text: #EBEBEB;
27
+ $json-schema-2020-12__attribute--primary: #9898FF;
28
+ $json-schema-2020-12__constraint--string: #D4AA53;
29
+
30
+ $opblock_colors: (
31
+ post: (#112929, #104834, #14392C, #00B572),
32
+ deprecated: (#272C34, #495361, #262E36, #6A6A6A),
33
+ put: (#27201E, #523524, #9a5b3e, #FF7D35),
34
+ get: (#182536, #294262, #1C3043, #55A1FF),
35
+ delete: (#241A20, #4B2420, #2F2020, #EB6156),
36
+ patch: (#11282F, #16494B, #113239, #03B7BF),
37
+ head: (#282231, #44336A, #352C45, #B889FF),
38
+ options: (#202C3C, #33465E, #314558, #6895C8),
39
+ );
40
+
41
+ html.dark-mode {
42
+ background: $neutral-98;
43
+
44
+ .swagger-ui {
45
+ color: $neutral-20;
46
+ background: $neutral-98;
47
+
48
+ .authorization__btn svg,
49
+ .expand-operation svg,
50
+ .opblock-control-arrow svg {
51
+ fill: $neutral-40;
52
+ opacity: 1;
53
+ }
54
+
55
+ section h3 {
56
+ color: $neutral-20;
57
+ }
58
+
59
+ table thead tr {
60
+ td, th {
61
+ color: $neutral-20;
62
+ }
63
+ }
64
+
65
+ .markdown, .renderedMarkdown {
66
+ p, pre {
67
+ color: $neutral-20;
68
+ }
69
+
70
+ code {
71
+ background: $neutral-100;
72
+ color: $markdown-code;
73
+ }
74
+ }
75
+
76
+ // ------ INPUT / TEXTAREA / SELECT ------
77
+
78
+ input {
79
+ background: $neutral-98;
80
+ border-color: $neutral-40;
81
+ color: $neutral-10;
82
+
83
+ &:focus:not(.download-url-input) {
84
+ border-color: $link !important;
85
+ box-shadow: none;
86
+ outline: none;
87
+ }
88
+ }
89
+
90
+ textarea {
91
+ background: $textarea;
92
+ border: 1px solid $textarea;
93
+ color: $neutral-10;
94
+
95
+ &:focus {
96
+ border-color: $link;
97
+ }
98
+
99
+ &[disabled] {
100
+ background-color: $textarea-disabled;
101
+ border-color: $textarea-disabled;
102
+ color: $neutral-50;
103
+ }
104
+ }
105
+
106
+ select {
107
+ background: $neutral-98
108
+ url('data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="#B7BCBF" d="M13.418 7.859c.271-.268.709-.268.978 0 .27.268.272.701 0 .969l-3.908 3.83c-.27.268-.707.268-.979 0l-3.908-3.83c-.27-.267-.27-.701 0-.969.271-.268.709-.268.978 0L10 11l3.418-3.141z"/></svg>')
109
+ right 10px center no-repeat;
110
+ color: $neutral-10;
111
+ border-color: $neutral-40;
112
+ box-shadow: none;
113
+ outline: none;
114
+
115
+ &[multiple] {
116
+ background: $neutral-98;
117
+ }
118
+
119
+ &:focus {
120
+ border-color: $link;
121
+ }
122
+ }
123
+
124
+ input::placeholder, textarea::placeholder {
125
+ color: $neutral-10;
126
+ opacity: 0.5;
127
+ }
128
+
129
+ input.invalid, select.invalid, textarea.invalid {
130
+ background: $neutral-98;
131
+ border-color: $error-30;
132
+ }
133
+
134
+ // ------ TOPBAR ------
135
+
136
+ .topbar {
137
+ background: $neutral-95;
138
+
139
+ .download-url-wrapper {
140
+ .download-url-button {
141
+ color: $neutral-20;
142
+ background: $info-version-stamp;
143
+ }
144
+
145
+ .download-url-input {
146
+ border-color: $info-version-stamp;
147
+
148
+ &.failed {
149
+ color: $error-30;
150
+ }
151
+ }
152
+ }
153
+ }
154
+
155
+ // ------ MODAL ------
156
+
157
+ .dialog-ux {
158
+ .modal-ux {
159
+ background-color: $neutral-95;
160
+ color: $neutral-20;
161
+ border: none;
162
+
163
+ &-header {
164
+ border-color: $neutral-80;
165
+
166
+ .close-modal svg {
167
+ fill: $neutral-20;
168
+ }
169
+ }
170
+
171
+ h2, h3, h4, h5, p, label {
172
+ color: $neutral-20;
173
+ }
174
+
175
+ .scopes a {
176
+ color: $link;
177
+ }
178
+
179
+ .btn.modal-btn {
180
+ border-color: $authorize-button;
181
+ color: $authorize-button;
182
+ }
183
+
184
+ .btn.modal-btn.btn-done {
185
+ color: $neutral-20;
186
+ border-color: $neutral-20;
187
+ }
188
+
189
+ .auth-container {
190
+ border-color: $neutral-80;
191
+ }
192
+
193
+ .checkbox {
194
+ input[type="checkbox"] {
195
+ & + label > .item {
196
+ background: $neutral-80;
197
+ color: $neutral-10 !important;
198
+ box-shadow: none;
199
+ }
200
+
201
+ &:checked + label > .item {
202
+ background: $neutral-80
203
+ url('data:image/svg+xml, <svg width="10px" height="8px" viewBox="3 7 10 8" version="1.1" xmlns="http://www.w3.org/2000/svg"><polygon id="Rectangle-34" stroke="none" fill="#E4E6E6" fill-rule="evenodd" points="6.33333333 15 3 11.6666667 4.33333333 10.3333333 6.33333333 12.3333333 11.6666667 7 13 8.33333333"></polygon></svg>')
204
+ center center no-repeat;
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
210
+
211
+ // ------ LOADING SPINNER ------
212
+
213
+ .loading-container .loading {
214
+ &::before {
215
+ border-color: $neutral-80;
216
+ border-top-color: $neutral-20;
217
+ }
218
+
219
+ &::after {
220
+ color: $neutral-20;
221
+ }
222
+ }
223
+
224
+ // ------ SCHEMES / SERVERS ------
225
+
226
+ .scheme-container {
227
+ background: $neutral-98;
228
+ box-shadow: 0 1px 2px 0 $neutral-80;
229
+
230
+ .schemes > .schemes-server-container > label {
231
+ color: $neutral-20;
232
+ }
233
+
234
+ .btn.authorize {
235
+ border-color: $authorize-button;
236
+ color: $authorize-button;
237
+
238
+ svg {
239
+ fill: $authorize-button;
240
+ }
241
+ }
242
+ }
243
+
244
+ // ------ INFO ------
245
+
246
+ .info {
247
+ h1, h2, h3, h4, h5, .title {
248
+ color: $neutral-30;
249
+ }
250
+
251
+ li, p, table, .base-url {
252
+ color: $neutral-20;
253
+ }
254
+
255
+ a {
256
+ color: $link;
257
+ }
258
+
259
+ .title small {
260
+ background: $neutral-85;
261
+
262
+ &.version-stamp {
263
+ background: $info-version-stamp;
264
+ }
265
+ }
266
+
267
+ .errors-wrapper {
268
+ background: $neutral-85;
269
+ border-color: $error-30;
270
+
271
+ h4, span {
272
+ color: $neutral-20;
273
+ }
274
+
275
+ .btn.errors__clear-btn {
276
+ color: $neutral-20;
277
+ border-color: $neutral-20;
278
+ }
279
+ }
280
+ }
281
+
282
+ // ------ COPY / DOWNLOAD BUTTONS ------
283
+
284
+ .copy-to-clipboard, .download-contents {
285
+ background: $neutral-80;
286
+ color: $neutral-20;
287
+
288
+ button {
289
+ background: url("data:image/svg+xml, <svg xmlns='http://www.w3.org/2000/svg' width='16' height='15' aria-hidden='true'><g transform='translate(2, -1)'><path fill='#E4E6E6' fill-rule='evenodd' d='M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z'></path></g></svg>")
290
+ center center no-repeat;
291
+ }
292
+ }
293
+
294
+ // ------ TAG ------
295
+
296
+ .opblock-tag {
297
+ border-bottom-color: $neutral-80;
298
+ color: $neutral-20;
299
+
300
+ small {
301
+ color: $neutral-20;
302
+ }
303
+
304
+ a.link {
305
+ color: $link;
306
+ }
307
+ }
308
+
309
+ // ------ OPERATION ------
310
+
311
+ .opblock {
312
+ @each $type, $colors in $opblock_colors {
313
+ &.opblock-#{$type} {
314
+ background: list.nth($colors, 1);
315
+ border-color: list.nth($colors, 2);
316
+
317
+ thead {
318
+ tr {
319
+ th,
320
+ td {
321
+ border-color: list.nth($colors, 2);
322
+ opacity: 1;
323
+ }
324
+ }
325
+ }
326
+
327
+ .opblock-section-header {
328
+ background: list.nth($colors, 3);
329
+ border-top: 1px solid list.nth($colors, 2);
330
+ border-bottom: 1px solid list.nth($colors, 2);
331
+
332
+ .tab-header .tab-item .opblock-title span::after {
333
+ background: list.nth($colors, 4);
334
+ }
335
+ }
336
+
337
+ .opblock-summary {
338
+ border-bottom: none;
339
+ border-color: list.nth($colors, 2);
340
+
341
+ &-control {
342
+ &:focus {
343
+ outline: none;
344
+ }
345
+ }
346
+
347
+ &-method {
348
+ background: list.nth($colors, 4);
349
+ color: $neutral-100;
350
+ text-shadow: none;
351
+ }
352
+ }
353
+
354
+ .opblock-body > .opblock-description-wrapper,
355
+ .opblock-body > .opblock-title_normal {
356
+ border-top: 1px solid list.nth($colors, 2);
357
+ }
358
+ }
359
+ }
360
+
361
+ .opblock-section-header {
362
+ box-shadow: none;
363
+
364
+ h4 {
365
+ color: $neutral-20;
366
+ }
367
+
368
+ label {
369
+ color: $neutral-20;
370
+ }
371
+
372
+ .try-out__btn {
373
+ color: $neutral-20;
374
+ border-color: $neutral-40;
375
+ box-shadow: none;
376
+
377
+ &.cancel {
378
+ color: $error-30;
379
+ border-color: $error-30;
380
+ }
381
+ }
382
+ }
383
+
384
+ .btn.json-schema-form-item-add,
385
+ .btn.json-schema-form-item-remove {
386
+ color: $neutral-20;
387
+ border-color: $neutral-20;
388
+ }
389
+
390
+ .validation-errors.errors-wrapper {
391
+ background: $neutral-85;
392
+ border-color: $error-30;
393
+ color: $neutral-20;
394
+ }
395
+
396
+ .body-param-options label span {
397
+ color: $neutral-20;
398
+ }
399
+
400
+ .opblock-summary-operation-id,
401
+ .opblock-summary-path,
402
+ .opblock-summary-path__deprecated,
403
+ .opblock-summary-description,
404
+ .opblock-description-wrapper p,
405
+ .opblock-description-wrapper i,
406
+ .opblock-external-docs-wrapper,
407
+ .opblock-title_normal,
408
+ .parameter__name,
409
+ .parameter__type,
410
+ .parameter__type .prop-format,
411
+ .parameter__in,
412
+ .response-col_status,
413
+ .response-col_undocumented,
414
+ .response-col_links {
415
+ color: $neutral-20;
416
+ }
417
+
418
+ .opblock-external-docs a.link {
419
+ color: $link;
420
+ }
421
+
422
+ .parameter__name.required {
423
+ span {
424
+ color: $error-30;
425
+ }
426
+
427
+ &:after {
428
+ color: $error-30;
429
+ }
430
+ }
431
+
432
+ .parameter__empty_value_toggle {
433
+ color: $neutral-20;
434
+ }
435
+
436
+ .btn.execute {
437
+ background: $link;
438
+ border-color: $link;
439
+ color: $neutral-100;
440
+ }
441
+
442
+ .btn.btn-clear {
443
+ color: $neutral-20;
444
+ border-color: $neutral-20;
445
+ }
446
+
447
+ .highlight-code pre.microlight {
448
+ background: $neutral-95 !important;
449
+ color: $neutral-10;
450
+ }
451
+
452
+ .curl-command .btn {
453
+ background: $curl-command-button !important;
454
+ border-color: $neutral-95 !important;
455
+ color: $curl-command-button-text !important;
456
+
457
+ &.active {
458
+ background: $neutral-95 !important;
459
+ color: $neutral-20 !important;
460
+ }
461
+ }
462
+
463
+ pre.microlight {
464
+ background: $neutral-95 !important;
465
+ color: $neutral-10;
466
+ }
467
+
468
+ .model-example {
469
+ .tab button {
470
+ color: $neutral-20;
471
+ }
472
+
473
+ .tabitem::after {
474
+ background: $neutral-60;
475
+ }
476
+ }
477
+
478
+ .responses-inner {
479
+ h4, h5 {
480
+ color: $neutral-20;
481
+ }
482
+ }
483
+
484
+ .response-control-media-type--accept-controller {
485
+ select.content-type {
486
+ border-color: $success-30;
487
+ }
488
+
489
+ .response-control-media-type__accept-message {
490
+ color: $success-30;
491
+ }
492
+ }
493
+ }
494
+
495
+ // ------ MODEL ------
496
+
497
+ .model {
498
+ &-toggle {
499
+ &:after {
500
+ background: url('data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#e4e6e6" d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>')
501
+ center no-repeat;
502
+ background-size: 100%;
503
+ }
504
+ }
505
+
506
+ .prop-type {
507
+ color: $markdown-code;
508
+ }
509
+
510
+ .property-row, .brace-open, .brace-close, .prop-format, .property, .description {
511
+ color: $neutral-20;
512
+ }
513
+
514
+ .property-row.required .star {
515
+ color: $error-30;
516
+ }
517
+ }
518
+
519
+ .model-box {
520
+ background: $neutral-95;
521
+
522
+ .model-title, .model {
523
+ color: $neutral-20;
524
+ }
525
+
526
+ &-control {
527
+ &:focus {
528
+ outline: none;
529
+ }
530
+
531
+ &:not(.prop) {
532
+ color: $neutral-20;
533
+ }
534
+ }
535
+ }
536
+
537
+ // ------ JSON SCHEMA 2020-12 ------
538
+
539
+ .json-schema-2020-12 {
540
+ background: $neutral-95;
541
+
542
+ button {
543
+ background: $neutral-95;
544
+
545
+ svg {
546
+ fill: $neutral-20;
547
+ }
548
+ }
549
+
550
+ a {
551
+ color: $link;
552
+ }
553
+
554
+ &__title {
555
+ color: $neutral-20;
556
+ }
557
+
558
+ &-property--required > .json-schema-2020-12:first-of-type > .json-schema-2020-12-head .json-schema-2020-12__title::after {
559
+ color: $error-30;
560
+ }
561
+
562
+ &-expand-deep-button {
563
+ color: $neutral-40;
564
+ }
565
+
566
+ &-body {
567
+ border-color: $neutral-40;
568
+ }
569
+
570
+ &-keyword {
571
+ &__name {
572
+ &--primary {
573
+ color: $neutral-20;
574
+ }
575
+
576
+ &--secondary {
577
+ color: $neutral-40;
578
+ }
579
+ }
580
+
581
+ &__value {
582
+ &--secondary {
583
+ color: $neutral-40;
584
+ }
585
+
586
+ &--warning {
587
+ color: $error-30;
588
+ border-color: $error-30;
589
+ }
590
+ }
591
+
592
+ &--\$vocabulary {
593
+ ul {
594
+ border-color: $neutral-40;
595
+ }
596
+ }
597
+
598
+ &--patternProperties {
599
+ .json-schema-2020-12__title::before,
600
+ .json-schema-2020-12__title::after {
601
+ color: $json-schema-2020-12__attribute--primary;
602
+ }
603
+ }
604
+ }
605
+
606
+ &__attribute {
607
+ &--primary {
608
+ color: $json-schema-2020-12__attribute--primary;
609
+ }
610
+
611
+ &--muted {
612
+ color: $neutral-40;
613
+ }
614
+
615
+ &--warning {
616
+ color: $error-30;
617
+ }
618
+ }
619
+
620
+ &-json-viewer {
621
+ &__name--secondary, &__value--secondary {
622
+ color: $neutral-40;
623
+ }
624
+ }
625
+
626
+ &__constraint {
627
+ color: $neutral-100;
628
+ background: $json-schema-2020-12__attribute--primary;
629
+
630
+ &--string {
631
+ background: $json-schema-2020-12__constraint--string;
632
+ }
633
+ }
634
+ }
635
+
636
+ // ------ MODELS ------
637
+
638
+ section.models {
639
+ border-color: $neutral-80;
640
+
641
+ h4 {
642
+ border-color: $neutral-80;
643
+ }
644
+
645
+ h4 span {
646
+ color: $neutral-20;
647
+ }
648
+
649
+ .model-container {
650
+ background: $neutral-95;
651
+ }
652
+
653
+ .models-control {
654
+ &:focus {
655
+ outline: none;
656
+ }
657
+
658
+ svg {
659
+ fill: $neutral-40;
660
+ }
661
+ }
662
+ }
663
+ }
664
+ }
@@ -42,6 +42,8 @@
42
42
  display: flex;
43
43
  flex: 3;
44
44
  justify-content: flex-end;
45
+ max-width: 600px;
46
+ margin-left: auto;
45
47
 
46
48
  input[type="text"] {
47
49
  width: 100%;
@@ -100,4 +102,25 @@
100
102
  width: 100%;
101
103
  }
102
104
  }
105
+
106
+ .dark-mode-toggle {
107
+ margin-left: 10px;
108
+ opacity: 0.8;
109
+ transition: all .2s;
110
+ cursor: pointer;
111
+
112
+ button {
113
+ background: none;
114
+ border: none;
115
+ padding: 0;
116
+
117
+ svg {
118
+ fill: #E4E6E6;
119
+ }
120
+ }
121
+
122
+ &:hover {
123
+ opacity: 1;
124
+ }
125
+ }
103
126
  }
package/style/main.scss CHANGED
@@ -23,3 +23,6 @@
23
23
  @include meta.load-css("../core/plugins/json-schema-2020-12/components/all");
24
24
  @include meta.load-css("../core/plugins/oas31/components/all");
25
25
  }
26
+
27
+ // Themes must live outside of the '.swagger-ui' class to target HTML parent.
28
+ @include meta.load-css("dark-mode");