@scalar/fastify-api-reference 0.6.57 → 0.6.58
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/CHANGELOG.md +6 -0
- package/README.md +13 -0
- package/dist/templates/index.ejs +77 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -75,3 +75,16 @@ await fastify.register(require('@scalar/fastify-api-reference'), {
|
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
The fastify plugin takes our universal configuration object, [read more about configuration](https://github.com/scalar/scalar/tree/main/packages/api-reference#props) in the core package README.
|
|
78
|
+
|
|
79
|
+
## Themes
|
|
80
|
+
|
|
81
|
+
By default, we’re using a custom Fastify theme and it’s beautiful. But you can choose [one of our other themes](https://github.com/scalar/scalar/tree/main/packages/themes), too:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
await fastify.register(require('@scalar/fastify-api-reference'), {
|
|
85
|
+
routePrefix: '/reference',
|
|
86
|
+
apiReference: {
|
|
87
|
+
theme: 'purple',
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
```
|
package/dist/templates/index.ejs
CHANGED
|
@@ -11,6 +11,83 @@
|
|
|
11
11
|
margin: 0;
|
|
12
12
|
}
|
|
13
13
|
</style>
|
|
14
|
+
|
|
15
|
+
<% if (typeof options.apiReference?.theme === 'undefined') { %>
|
|
16
|
+
<style>
|
|
17
|
+
/* Fastify Theme */
|
|
18
|
+
.light-mode {
|
|
19
|
+
color-scheme: light;
|
|
20
|
+
--theme-color-1: #1c1e21;
|
|
21
|
+
--theme-color-2: #757575;
|
|
22
|
+
--theme-color-3: #8e8e8e;
|
|
23
|
+
--theme-color-disabled: #b4b1b1;
|
|
24
|
+
--theme-color-ghost: #a7a7a7;
|
|
25
|
+
--theme-color-accent: #2f8555;
|
|
26
|
+
--theme-background-1: #fff;
|
|
27
|
+
--theme-background-2: #f5f5f5;
|
|
28
|
+
--theme-background-3: #ededed;
|
|
29
|
+
--theme-background-4: rgba(0, 0, 0, 0.06);
|
|
30
|
+
--theme-background-accent: #2f85551f;
|
|
31
|
+
|
|
32
|
+
--theme-border-color: rgba(0, 0, 0, 0.1);
|
|
33
|
+
--theme-scrollbar-color: rgba(0, 0, 0, 0.18);
|
|
34
|
+
--theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);
|
|
35
|
+
--theme-lifted-brightness: 1;
|
|
36
|
+
--theme-backdrop-brightness: 1;
|
|
37
|
+
|
|
38
|
+
--theme-shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.11);
|
|
39
|
+
--theme-shadow-2: rgba(0, 0, 0, 0.08) 0px 13px 20px 0px,
|
|
40
|
+
rgba(0, 0, 0, 0.08) 0px 3px 8px 0px, #eeeeed 0px 0 0 1px;
|
|
41
|
+
|
|
42
|
+
--theme-button-1: rgb(49 53 56);
|
|
43
|
+
--theme-button-1-color: #fff;
|
|
44
|
+
--theme-button-1-hover: rgb(28 31 33);
|
|
45
|
+
|
|
46
|
+
--theme-color-green: #007300;
|
|
47
|
+
--theme-color-red: #af272b;
|
|
48
|
+
--theme-color-yellow: #b38200;
|
|
49
|
+
--theme-color-blue: #3b8ba5;
|
|
50
|
+
--theme-color-orange: #fb892c;
|
|
51
|
+
--theme-color-purple: #5203d1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dark-mode {
|
|
55
|
+
color-scheme: dark;
|
|
56
|
+
--theme-color-1: rgba(255, 255, 255, 0.9);
|
|
57
|
+
--theme-color-2: rgba(255, 255, 255, 0.62);
|
|
58
|
+
--theme-color-3: rgba(255, 255, 255, 0.44);
|
|
59
|
+
--theme-color-disabled: rgba(255, 255, 255, 0.34);
|
|
60
|
+
--theme-color-ghost: rgba(255, 255, 255, 0.26);
|
|
61
|
+
--theme-color-accent: #27c2a0;
|
|
62
|
+
--theme-background-1: #1b1b1d;
|
|
63
|
+
--theme-background-2: #242526;
|
|
64
|
+
--theme-background-3: #3b3b3b;
|
|
65
|
+
--theme-background-4: rgba(255, 255, 255, 0.06);
|
|
66
|
+
--theme-background-accent: #27c2a01f;
|
|
67
|
+
|
|
68
|
+
--theme-border-color: rgba(255, 255, 255, 0.1);
|
|
69
|
+
--theme-scrollbar-color: rgba(255, 255, 255, 0.24);
|
|
70
|
+
--theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);
|
|
71
|
+
--theme-lifted-brightness: 1.45;
|
|
72
|
+
--theme-backdrop-brightness: 0.5;
|
|
73
|
+
|
|
74
|
+
--theme-shadow-1: 0 1px 3px 0 rgb(0, 0, 0, 0.1);
|
|
75
|
+
--theme-shadow-2: rgba(15, 15, 15, 0.2) 0px 3px 6px,
|
|
76
|
+
rgba(15, 15, 15, 0.4) 0px 9px 24px, 0 0 0 1px rgba(255, 255, 255, 0.1);
|
|
77
|
+
|
|
78
|
+
--theme-button-1: #f6f6f6;
|
|
79
|
+
--theme-button-1-color: #000;
|
|
80
|
+
--theme-button-1-hover: #e7e7e7;
|
|
81
|
+
|
|
82
|
+
--theme-color-green: #26b226;
|
|
83
|
+
--theme-color-red: #fb565b;
|
|
84
|
+
--theme-color-yellow: #ffc426;
|
|
85
|
+
--theme-color-blue: #6ecfef;
|
|
86
|
+
--theme-color-orange: #ff8d4d;
|
|
87
|
+
--theme-color-purple: #b191f9;
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
90
|
+
<% } %>
|
|
14
91
|
</head>
|
|
15
92
|
<body>
|
|
16
93
|
<% if (options.apiReference?.spec?.url) { %>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalar/fastify-api-reference",
|
|
3
3
|
"description": "a fastify plugin to render an API reference from a Swagger spec",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.58",
|
|
5
5
|
"author": "Scalar (https://github.com/scalar)",
|
|
6
6
|
"bugs": "https://github.com/scalar/scalar/issues/new",
|
|
7
7
|
"dependencies": {
|