docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

Be able to style operation "pills" in output docs

Open thomasheartman opened this issue 1 year ago • 0 comments

Is your feature request related to a problem?

The generated pages include operation buttons/pills next to the path. These seem to be rendered as normal docusaurus badges:

image

There's two issues:

  1. The color scheme doesn't necessarily have high enough contrast. That's arguably on us and our configuration, however.
  2. When using the operation buttons next to the buttons (as you do in your examples), there might be a bit of mismatch between the buttons and colors. E.g.: Sidebar: image Page: image

The operation pills on the page don't seem to have a distinct class or anything that I can reach into for easy styling purposes.

Describe the solution you'd like

I'd like to be able to style the pills that appear next to the path, so that we can keep a consistent visual theme going and to ensure that operations use the same colors.

What strikes me as the easiest solution would be to use a similar class naming scheme as you use for the sidebar, adding a class name that matches the operation. Maybe simply adding the operation type to the pill class?

Describe alternatives you've considered

I tried looking for some other classes that distinguish the openapi pages from others, but couldn't find any. In theory, we could rewrite all badges to use the color scheme that we use for API operations, but that might impact something else (though I'm not sure we use any badges anywhere today).

Additional context

I think all context is described above, but I'd be happy to add anything else if you're wondering about anything 😄

thomasheartman avatar Sep 08 '22 11:09 thomasheartman