docusaurus-openapi
docusaurus-openapi copied to clipboard
feat(openapi): redesigned params table
This PR builds on https://github.com/cloud-annotations/docusaurus-openapi/pull/211, we should likely review that first and then subsequent PRs.
What's new
- Adds
ApiItem/ParamsTablecomponent todocusaurus-theme-openapi- This component renders the individual param sections (query params, params, headers, and cookies)
- Adds
ApiItem/ContentSectioncomponent todocusaurus-theme-openapi- This component is an internal component used by the param sections and eventually the responses and request body sections.
- Re-enables the theme toggle to the demo
- We should be able to toggle the light/dark theme to see the display of the components
Deploy Preview for docusaurus-openapi ready!
| Name | Link |
|---|---|
| Latest commit | 7b2b516a8017ce30af84622914a2eda1df605a4c |
| Latest deploy log | https://app.netlify.com/sites/docusaurus-openapi/deploys/63142f4a573c1f0008fe3d7e |
| Deploy Preview | https://deploy-preview-212--docusaurus-openapi.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
This looks really nice, but I would rather keep the default theme to look as close to the default Docusaurus theme as possible (even if it doesnβt look as good), but provide an easy way for people to customize the look and feel to match this if they wanted. We could also provide a second theme that looks like this, but will also change the look and feel of the rest of Docusaurus to match?
I think the only constraint with an additional theme, is that a lot of the logic responsibility is coupled with the theme and the components within it. An additional theme would increase the complexity and maintenance scope of this library.
If the desired goal is to align the appearance with Docusaurus, I would suggest the styling is updated to match the stock experience more closely, but offer CSS variables, static CSS selectors, or another mechanism for developers to customize the look further.
Before starting this work, I would want to verify you are still ok with the changes of moving the rendering into JSX like I have demonstrated in these various PRs; while maintaining support for rich markdown support for the various description fields.
If not, I think the work effort may be more appropriate as a fork based on the level of customizations required.
Yep, I love what you're doing with the JSX rendering. I'm also good with the structural UI changes (like moving things around, adding features, etc...). I'd just prefer to keep the overall look and feel as close to the default Docusaurus theme as we can. Things like color, rounded corner size, borders, shadows etc...
This and the parent work for the header section has been updated to remove a lot of custom opinionated styling.
For areas where developers or myself need to theme the experience further, we can probably follow the styling convention that Docusaurus already exhibits:
#__docusaurus {
[class*="docPage_"] {
[class*="paramItem_"] {
/* custom styles */
}
}
}