Some tweaks to the API styling

- Update the logo
- Make fonts and colors a bit more consistent with the rest of the docs
- Don't uppercase TOC menu items
- Update _fetch_upstream_resources script to make the logo-URL relative
  to the current website.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-06-09 17:12:07 +02:00
parent d138f894ad
commit 56e601033a
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
5 changed files with 68 additions and 78 deletions

View File

@ -29,6 +29,9 @@ svn co "https://github.com/docker/compose-cli/${compose_cli_svn_branch}/docs"
svn co "https://github.com/docker/distribution/${distribution_svn_branch}/docs/spec" ./registry/spec || (echo "Failed registry/spec download" && exit 1)
svn co "https://github.com/mirantis/compliance/trunk/docs/compliance" ./compliance || (echo "Failed docker/compliance download" && exit 1)
# Fix up URls in swagger files
find ./engine/api -type f -name '*.yaml' | while read i; do sed -i 's#https://docs.docker.com/#/#g' "$i"; done;
# Cleanup svn directories
find . -name ".svn" -print0 | xargs -0 /bin/rm -rf

View File

@ -1,25 +0,0 @@
/**
* Styles for the Swagger API documentation (engine/api/v1.x/index.html)
*/
/* ReDoc doesn't change outer page styles */
body {
margin: 0;
padding: 0;
}
api-logo {
background-image: linear-gradient(0deg, #15A4D7 0%, #1488C6 100%);
height: 100px;
text-align: left !important;
}
api-logo img {
width: 136px !important;
margin: 32px 0 0 50px;
}
/**
* Disable request-type badges, see https://github.com/Rebilly/ReDoc/issues/61
*/
redoc .operation-type {
display: none !important;
}

51
css/api-reference.scss Normal file
View File

@ -0,0 +1,51 @@
---
# Docker Documentation Theme
---
@import "variables";
@import "typography";
/**
* Styles for the Swagger API documentation (engine/api/v1.x/index.html)
*/
/* ReDoc doesn't change outer page styles */
body {
margin: 0;
padding: 0;
}
api-logo {
background-color: $bg-header;
height: 60px;
text-align: left !important;
img {
width: 160px !important;
margin: 15px 20px;
}
}
redoc {
h1 {
font-size: 32px !important;
}
h1,h2,h3,h4,h5,h6 {
font-family: $headings !important;
color: inherit !important;
}
p, a, .menu-item-title {
font-family: $font !important;
}
a, .menu-item-title {
color: $primary-links !important;
}
.menu-item-title {
text-transform: none;
}
// Disable request-type badges, see https://github.com/Rebilly/ReDoc/issues/61
.operation-type {
display: none !important;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 20 KiB