Giter VIP home page Giter VIP logo

swagger-ui-themes's People

Contributors

dapicester avatar denniskae avatar gracefullight avatar openam avatar ostranme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swagger-ui-themes's Issues

Make feeling blue just a little bit more blue

Hi,

here are some suggestions to make feeling blue just a little bit more blue. ;-)

.swagger-section #header {
	background-color: #0489bf;
}

.swagger-section .swagger-ui-wrap a {
	color: #00547f;
}

.swagger-section .swagger-ui-wrap pre {
	background-color: #f6f6fc;
}

.swagger-section .swagger-ui-wrap .model-signature pre:hover {
	background-color: #e6e6fc;
}

Swagger-UI 3.x not loading 3.x Themes

Preface: Apologies if this is a noobish question, Frontend development is not my domain of expertise. :(

I cannot get Swagger-UI 3.x to load any 3.x swagger-ui-theme CSS. Rather, the default CSS theme is always being loaded. Using my browser's debug tools I can see the JS console is error free, and the theme-xxx.css I specify (using your instructions) is in fact being served to the browser.

Below is a Dockerfile and a couple BASH commands to replicate the issue quickly (all work on Linux or Windows + Cygwin + Docker Toolbox).

  1. Write the below lines into a file named Dockerfile:
FROM swaggerapi/swagger-ui:v3.0.2
# mount an index file with the `<link rel="stylesheet" href="path/to/theme.css" />` one-liner
COPY ./index-feeling-blue.html /usr/share/nginx/html/index.html
COPY ./theme-feeling-blue.css /usr/share/nginx/html/css/theme-feeling-blue.css
EXPOSE 8080
  1. Use your favorite means to obtain your preferred 3.x theme CSS from this repo (in my case feeling-blue).

  2. Obtain the swagger-ui index.html via this link (you may need to fix the paths to the swagger-ui js components) or from the docker image referenced in the first line:

docker pull swaggerapi/swagger-ui:v3.0.2
# use docker run to start a container using the swagger-ui image, and obtain its container id
$ docker run -d swaggerapi/swagger-ui:v3.0.2
<container_id>

# shell into the docker
$ docker exec -it <container_id> /bin/sh
/ # cat /usr/share/nginx/html/index.html
  1. Put the theme CSS, Dockerfile, and custom index.html into a common directory, change into it, then run:
docker build -t <your_registry>/<your_image>:<your_tag> .
docker run -d -p 8080:8080 <your_registry>/<your_image>:<your_tag>
  1. Goto http://localhost;8080 and observe that your desired theme is NOT loaded.

Fully dark mode

Would be amazing to have dark mode, my eye cries on white bg

unable to load gif in version 2

When using the version 2 of the CSS, the loader gif is not found.

Changing line 883 from:

background-image: url('../images/throbber.gif');

To:

background-image: url('../images/throbber-gif');

solved the problem.

Theme not loading for Swagger 2 on httpd or gh-pages

I am attempting to try a theme on httpd on docker and on gh-pages. However, the css does not apply to the swagger.

Directory Structure:
image

Index.html:

<html>
    <head>
        <!-- Load the latest Swagger UI code from npm using unpkg.com -->
        <script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script>

        <!-- Load the theme -->
        <link rel="stylesheet" type="text/css" href="/themes/css/theme-feeling-blue.css"/>
        
        <title>My New API</title>
    </head>
    <body>
        <a href="/">Go Back to Documentation</a>
        <div id="swagger-ui"></div> <!-- Div to hold the UI component -->
        <script>
            window.onload = function () {
                // Begin Swagger UI call region
                const ui = SwaggerUIBundle({
                    url: "swagger2.json", //Location of Open API spec in the repo
                    dom_id: '#swagger-ui',
                    deepLinking: true,
                    presets: [
                        SwaggerUIBundle.presets.apis,
                        SwaggerUIBundle.SwaggerUIStandalonePreset
                    ],
                    plugins: [
                        SwaggerUIBundle.plugins.DownloadUrl
                    ],
                })
                window.ui = ui
            }
        </script>
    </body>
</html>

httpd conf mime types:

    AddType 'text/css; charset=UTF-8' css
    AddType text/javascript .js

[Theme] Type

Create a theme using different types/fonts. Bigger/smaller text.

  • Pick font
  • Mockup what the design should be

Add License

Hi @ostranme,
would you mind to release this Repository under a License?
Maybe MIT or Apache 2?

Compatibility with Swagger UI 4.x

Applying the themes for v 3.x seems to work ok but probably a few things getting missed out - most blatant the "models" section at the bottom isn't themed at all, so I'm assuming that's new as of v4.

Any plans to accommodate?

Thanks

define "swagger-ui html"

Hi,

the instruction says to place the desired stylesheet into the source of your swagger-ui html
When I'm in swagger editor: how do I obtain my swagger-ui html? There's Generate Client => html , Generate Client => html2, I can right click the right pane and Save as.

What is the right HTML page your CSS files style?

Best,
Bernhard Döbler

Flattop breaks syntax highlighning

Would be great to keep the JSON highlighting.

Looks like it's this block:

.swagger-ui .opblock-body pre span {
  color: #fff !important;
}

I think another style of swagger-ui menus needed, not a theme.

I like your themes very much, their colors are very cool!
But I think one thing is more important.

I hate the default style of swagger-ui's menus, I must to roll the mouse mid-wheels and click the small menus very frequently. It makes my hands tired. So, I think if we create a left-sidebar , and put the menus on it, it will be popular !

Make SCSS Theme Files Available

Were these themes developed using a css preprocessor? Any chance the file might be made available? I really like the Flat top theme but want to slightly modify it to match brand colors.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.