Skip to content

Swagger Dark Mode by pyrophire

Details

Authorpyrophire

LicenseNo License

Categorylocalhost

Created

Updated

Size5.6 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Enable dark mode for swagger 3+

Notes

Userstyle doesn't have notes.

Source code

@name Swagger Dark Mode
@namespace pyrophire
@version 1.0.0
@-moz-document regexp("^https?:\\/\\/[^\\/]+\\/api(\\/.*)?$"), regexp("^https?:\\/\\/[^\\/]+\\/swagger\\/.*") {
.swagger-ui .info .title,
.swagger-ui a.nostyle,
.swagger-ui .parameter__name,
.swagger-ui .parameter__type,
.swagger-ui .parameter__deprecated,
.swagger-ui .parameter__in,
.swagger-ui table thead tr th,
.swagger-ui .response-col_status,
.swagger-ui table thead tr td,
.swagger-ui .opblock .opblock-section-header h4,
.swagger-ui label,
.swagger-ui .tab li,
.swagger-ui .opblock .opblock-section-header label,
.swagger-ui .btn {
    color: rgba(255, 255, 255, 0.875);
}
body,
.swagger-ui .info .title,
.swagger-ui .scheme-container,
.swagger-ui select {
    background-color: #222;
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .wrapper .block {
    background-color: transparent;
}
.swagger-ui .block .models,
.swagger-ui .block .opblock-tag-section {
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.swagger-ui .opblock .opblock-section-header {
    background-color: transparent;
    box-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
}
.swagger-ui textarea,
.swagger-ui input[type="text"] {
    background-color: #41444e;
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .topbar {
    background-color: #000;
}
.swagger-ui .info .base-url {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .scheme-container .schemes > label {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui section.models h4 {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .model-title {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .model {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .opblock-tag {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui a.nostyle,
.swagger-ui a.nostyle:visited {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-external-docs-wrapper p,
.swagger-ui .opblock-title_normal p {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .responses-inner h4,
.swagger-ui .responses-inner h5 {
    color: rgba(255, 255, 255, 0.875);
}
.arrow {
    fill: rgba(255, 255, 255, 0.875);
}
#large-arrow-down {
    fill: rgba(255, 255, 255, 0.875);
}
.model-toggle collapsed {
    fill: rgba(255, 255, 255, 0.875);
}
.swagger-ui {
    color: rgba(255, 255, 255, 0.875);
}
.swagger-ui .prop-type {
    color: #aeaef2;
}
.swagger-ui .opblock-tag {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.swagger-ui .model-toggle::after {
    display: block;
    width: 20px;
    height: 20px;
    content: "";
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg'  width='24' height='24' fill='%23FFFFFF' viewBox='0 0 24 24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") 50% no-repeat;
    background-size: auto;
    background-size: 100%;
}
.swagger-ui select {
    font-size: 14px;
    font-weight: 700;
    padding: 5px 40px 5px 10px;
    border: 2px solid #4e4641;
    border-radius: 4px;
    background: #f7f7f7 url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+ICAgIDxwYXRoIGQ9Ik0xMy40MTggNy44NTljLjI3MS0uMjY4LjcwOS0uMjY4Ljk3OCAwIC4yNy4yNjguMjcyLjcwMSAwIC45NjlsLTMuOTA4IDMuODNjLS4yNy4yNjgtLjcwNy4yNjgtLjk3OSAwbC0zLjkwOC0zLjgzYy0uMjctLjI2Ny0uMjctLjcwMSAwLS45NjkuMjcxLS4yNjguNzA5LS4yNjguOTc4IDBMMTAgMTFsMy40MTgtMy4xNDF6Ii8+PC9zdmc+) right 10px center no-repeat;
    background-color: rgb(247, 247, 247);
    background-size: auto;
    background-size: 20px;
    -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    font-family: sans-serif;
    color: #3b4151;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.swagger-ui pre:not(.version) {
    background-color: #555 !important;
}
.swagger-ui .response-control-media-type__accept-message {
    color: rgb(0, 255, 51) !important;
}
.btn.try-out__btn {
    color: rgba(255, 255, 255, 0.875);
    background-color: rgb(0, 136, 255);
    border-color: #fff;
}

.swagger-ui .topbar .link {
    background-image: url("/swagger-ui/img/logo.png");
    background-size: contain;
    background-position: left center;
    background-repeat: no-repeat no-repeat;
    height: 64px;
}
.swagger-ui .topbar img,
.swagger-ui .topbar span {
    display: none;
}
.swagger-ui .prop-format,
.swagger-ui .model .property.primitive {
    color: #aaa;
}
.swagger-ui .response-col_links {
    color: #aaa;
}
.swagger-ui .opblock .opblock-summary-description {
    color: #d7d9dc;
}

.swagger-ui button svg {
    fill: white;
}

.swagger-ui .parameter__name.required:after {
    color: rgba(255, 100, 100, 1);
}

.swagger-ui .dialog-ux .modal-ux {
    background-color: #222;
    color: rgba(255, 255, 255, 0.875);
    border-color: rgba(255, 255, 255, 0.7);
}

.swagger-ui .dialog-ux .modal-ux-header {
    border-bottom: rgba(0,0,0, 0.7);
}

.swagger-ui .dialog-ux .modal-ux .modal-ux-header h3,
.swagger-ui .dialog-ux .modal-ux-content h4,
.swagger-ui .dialog-ux .modal-ux-content p {
    color: currentColor;
}

.swagger-ui section.models .model-container {
    background-color: rgba(255, 255, 255, 0.05);
}

.swagger-ui section.models .model-container:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.swagger-ui .info li,
.swagger-ui .info p,
.swagger-ui .info table {
    color: rgba(255, 255, 255, 0.5);
}
}

Reviews

No reviews yet.