Skip to content

Commit e25d486

Browse files
authored
Extract Swagger CSS to its own file (#12616)
1 parent 65444c5 commit e25d486

File tree

3 files changed

+32
-27
lines changed

3 files changed

+32
-27
lines changed

templates/swagger/ui.tmpl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,6 @@
44
<meta charset="UTF-8">
55
<title>Gitea API</title>
66
<link href="{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet">
7-
<style>
8-
html {
9-
box-sizing: border-box;
10-
overflow-y: scroll;
11-
}
12-
*, *:before, *:after {
13-
box-sizing: inherit;
14-
}
15-
body {
16-
margin: 0;
17-
background: #fff;
18-
}
19-
.swagger-back-link {
20-
color: #1f69c0;
21-
text-decoration: none;
22-
position: absolute;
23-
top: 1rem;
24-
right: 1.5rem;
25-
display: flex;
26-
align-items: center;
27-
}
28-
.swagger-back-link svg {
29-
color: inherit;
30-
fill: currentcolor;
31-
margin-right: .5rem;
32-
}
33-
</style>
347
</head>
358
<body>
369
<a class="swagger-back-link" href="{{AppUrl}}">{{svg "octicon-reply" 16}}{{.i18n.Tr "return_to_gitea"}}</a>

web_src/less/standalone/swagger.less

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
html {
2+
box-sizing: border-box;
3+
overflow-y: scroll;
4+
}
5+
6+
*,
7+
*:before,
8+
*:after {
9+
box-sizing: inherit;
10+
}
11+
12+
body {
13+
margin: 0;
14+
background: #fff;
15+
}
16+
17+
.swagger-back-link {
18+
color: #1f69c0;
19+
text-decoration: none;
20+
position: absolute;
21+
top: 1rem;
22+
right: 1.5rem;
23+
display: flex;
24+
align-items: center;
25+
}
26+
27+
.swagger-back-link svg {
28+
color: inherit;
29+
fill: currentColor;
30+
margin-right: .5rem;
31+
}

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module.exports = {
5050
],
5151
swagger: [
5252
resolve(__dirname, 'web_src/js/standalone/swagger.js'),
53+
resolve(__dirname, 'web_src/less/standalone/swagger.less'),
5354
],
5455
serviceworker: [
5556
resolve(__dirname, 'web_src/js/serviceworker.js'),

0 commit comments

Comments
 (0)