-
Notifications
You must be signed in to change notification settings - Fork 196
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
Swizzling components doesn't work #246
Comments
Hi @sradu, I am still investigating but it should be possible to replace the icons with text using pure CSS (custom.css). Still, I think there should be a cleaner way to handle this. |
Here's an example of how to override using CSS: .code__tab--bash {
padding-left: 1rem !important;
padding-right: 1rem !important;
}
.code__tab--bash::after {
background: none !important;
width: unset !important;
height: unset !important;
content: "BASH" !important;
font-size: 12px !important;
font-weight: normal !important;
color: var(--ifm-font-color-base);
}
.code__tab--python {
padding-left: 1rem !important;
padding-right: 1rem !important;
}
.code__tab--python::after {
background: none !important;
width: unset !important;
height: unset !important;
content: "Python" !important;
font-size: 12px !important;
font-weight: normal !important;
color: var(--ifm-font-color-base);
}
.code__tab--go {
padding-left: 1rem !important;
padding-right: 1rem !important;
}
.code__tab--go::after {
background: none !important;
width: unset !important;
height: unset !important;
content: "Go" !important;
font-size: 12px !important;
font-weight: normal !important;
color: var(--ifm-font-color-base);
}
.code__tab--nodejs {
padding-left: 1rem !important;
padding-right: 1rem !important;
}
.code__tab--nodejs::after {
background: none !important;
width: unset !important;
height: unset !important;
content: "NodeJS" !important;
font-size: 12px !important;
font-weight: normal !important;
color: var(--ifm-font-color-base);
}
.code__tab--csharp {
padding-left: 1rem !important;
padding-right: 1rem !important;
}
.code__tab--csharp::after {
background: none !important;
width: unset !important;
height: unset !important;
content: "C#" !important;
font-size: 12px !important;
font-weight: normal !important;
color: var(--ifm-font-color-base);
} |
Thank's @sserrata, really appreciate you making this for me! Will give it a try, but would still be nice to be able to swizzle. |
@sserrata any ETA on the PR that will allow us to swizzle? The docusaurus 2.2.0 changes broke some customizations I had and I have no idea how to make them work now. For instance, I had this css:
Which allowed me to avoid applying some CSS for the API reference. But now the structure has changed to what is below which is fine just that I don't want to keep on playing around with the CSS, if that makes sense.
|
Hi, Same for me, swizzling any component from either I would like to add a reaction component at the end of the article, so pure CSS won't work for me. |
Update: Looking into, I tried to But it fail when trying to eject or wrap components from the Also found that CSS classes used on "normal" page docs are the openapi theme classes and not the ones from the docusaurus theme-classic. For example, if I go to some docs that are not generated from the swagger, the main class before the central article is: So I suspect that Swizzling the |
Hi everyone, after some experimenting I believe I confirmed the root cause. We're using relative path imports throughout the OpenAPI theme which breaks after swizzling. The fix will require refactoring all theme components to import from |
Ok, swizzling support is now available for preview using canary release |
Hi, when this will be released on an stable version? |
With |
Describe the problem
I can't figure out why this doesn't work and wondering if other people are running into this. I'm looking to swizzle CodeTabs so I can remove the icons and have it be text only.
After running:
And choosing either Eject or Wrap I get the proper files in the theme/ folder but modifying them doesn't yield any changes. I tried running
gen-api-docs all
and everything is still the same.Suggested fix
Would be great to document how to Swizzle with this plugin.
The text was updated successfully, but these errors were encountered: