Comments (9)
That's okay, I had some suggestions for making the theming more consistent with Docusaurus but I'm realizing it's probably better for me to submit those as pull requests here rather than customizing my own.
from redocusaurus.
You can already override primaryColor
, just pass it in the theme
options. See example here:
redocusaurus/example/docusaurus.config.js
Lines 27 to 30 in 4f36105
from redocusaurus.
Not in redocOptions
because then there would be no point of this plugin, it's supposed to provide compatibility with docusaurus theme and dark mode. But you can make your own ApiDoc component and specify that to be used by the plugin:
https://github.com/rohit-gohri/redocusaurus/tree/main/packages/docusaurus-plugin-redoc#apidoccomponent-default-themeapidoc
If you want then I can export the getThemeOptions
helper directly so you can make your own theme with Dark mode support?
from redocusaurus.
That would be great
from redocusaurus.
@joshtemple any luck with the PR? I saw you had a PR moving the font weight around but not about overriding the theme.
@rohit-gohri You seem to be stripping the "theme" property from the redocOptions in "/docusaurus-theme-redoc/src/index.ts". Is there a way to make it optional for the user to either specify the "primaryColor" or provide a baseTheme object?
I just spent hours trying to set things up on my machine to create a PR but failed miserably to setup my environment (quite a noob when it comes to TS, node, and docusaurus).
(trying to implement something similar to https://davidgoss.co/blog/api-documentation-redoc-docusaurus/)
from redocusaurus.
Let me know if this solves your problem @bash83, if not then I'll try to add a baseTheme
option
from redocusaurus.
@rohit-gohri Iβm actually trying to override the font but figured why not allow user to override any value (I know this might complicate things with dark/light theme but itβs on user to sort it out)
from redocusaurus.
If you want to override all the values you can just swizzle the component and customize everything, it's just a React component:
npm run swizzle -- docusaurus-theme-redoc Redoc --danger
Let me know if you face any problems with that.
You can also just directly specify your own component with the apiDocComponent
option.
from redocusaurus.
Swizzle now works without --danger
flag:
JSX Component:
yarn docusaurus swizzle docusaurus-theme-redoc Redoc
TSX Component:
yarn docusaurus swizzle docusaurus-theme-redoc Redoc --typescript
I have abstracted away the theme merging logic out of the component, so customizing them should be more straightforward now:
You get two theme configs from plugin data: lightTheme
and darkTheme
, you can just merge this over your custom baseTheme
before passing it to Redoc
from redocusaurus.
Related Issues (20)
- Error: "presets[0]" does not match any of the allowed types HOT 2
- Webpack "Failed to fetch" issue HOT 8
- Memory regeneration problem when generating with cyclic dependencies HOT 6
- Extend deploy script to sign git commits. HOT 1
- [ERROR] TypeError: Cannot set properties of undefined (setting 'minItems') HOT 9
- CSS broken HOT 1
- Callbacks lack proper background in dark mode HOT 1
- Is there a way to run the APIs through the redoc component ? HOT 1
- Support for Docusaurus 3.0 HOT 9
- Example not hidden for schema imports
- Redocusaurus should collect heading ids / anchors HOT 2
- Webpack missing in Peer Dependencies HOT 1
- Error: Docusaurus server-side rendering could not render static page with path /api/ because of error: slugify: string argument expected HOT 2
- Issue with calling useColorMode outside the ColorModeProvider for Docusaurus 3.0.1 HOT 5
- Logo from spec (x-logo) not being rendered. HOT 3
- Add warning for deprecated options and remove them in next breaking version
- Generate code samples
- Support versioning API along with docs HOT 1
- API Reference page on mobile device HOT 2
- Footer UI defect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redocusaurus.