Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to customize the swagger UI iframe with website dark and light mode #21

Open
swarna1101 opened this issue Feb 10, 2024 · 1 comment

Comments

@swarna1101
Copy link

swarna1101 commented Feb 10, 2024

The problem I am facing is , I am not able to customize the swagger UI iframe in the page.

For better readability, I want to change the colour of text inside the swagger UI which is rendered in light and dark mode.

Right now, I am not able to do that, I added some custom css for the swagger UI texts, and although it is readable, but still the colour of text of the swagger UI iframe (which is rendered using this pluggin) does not changes as i change the mode from dark to light.

can you tell me a way, how I can customize the text colour of swagger UI which is rendered as per light and dark mode and for better readability.

To sum up: I want to change the colour of the text inside the swagger UI rendered docs as per light and dark mode. I want this customization for better readability. Currently, I added some css and made the things readable, but I want the texts of the swagger UI changes as per light and dark mode. If possible, pls help me in this or tell a way to make it work.

Thanks

@swarna1101 swarna1101 changed the title Not able to customize the swagger UI iframw with website dark and light mode Not able to customize the swagger UI iframe with website dark and light mode Feb 10, 2024
@blueswen
Copy link
Owner

Currently, we can customize CSS with extra_css options, which is discussed in #7. The extra_css options usage is as follows:

plugins:
  swagger-ui-tag:
    extra_css:
      - stylesheets/extra.css

The directory structure would be like:

.
├─ docs/
│  └─ stylesheets/
│     └─ extra.css
└─ mkdocs.yml

However, the extra CSS cannot be loaded dynamically according to the light mode or dark mode. I may take some time to check how to implement this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants