I'd like to volunteer to write usage of the theme options.
Any chance you can give me some guidance on how to use it so I can get started?
@imnotashrimp awesome! Thanks!
The preferred way to use a theme is to pass it in the options of Redoc.init call: https://github.com/Rebilly/ReDoc#advanced-usage-of-standalone-version:
Redoc.init('http://petstore.swagger.io/v2/swagger.json', {
theme: {
main: '#ff0000'
}
}, document.getElementById('redoc-container'))
See the default theme for details: https://github.com/Rebilly/ReDoc/blob/master/src/theme.ts#L3
note you can use functions in the theme e.g.:
https://github.com/Rebilly/ReDoc/blob/63ae2e8e943b1cf2838db20c6c567156a2bfac45/src/theme.ts#L35
Theme can't be used on <redoc> tag attributes yet.
Feel free to ask additional question!
So did I understand correctly that you can not theme ReDoc by using <redoc theme=""> at all the moment?
You have to use React component or Redoc.init to actually be able to theme anything?
@jjylha, yes, you've got it correctly.
@imnotashrimp Any updates on this?
Following
Following
Following
Following
PR for this opened here https://github.com/Redocly/redoc/pull/1438
Most helpful comment
@imnotashrimp awesome! Thanks!
The preferred way to use a theme is to pass it in the options of
Redoc.initcall: https://github.com/Rebilly/ReDoc#advanced-usage-of-standalone-version:See the default theme for details: https://github.com/Rebilly/ReDoc/blob/master/src/theme.ts#L3
note you can use functions in the theme e.g.:
https://github.com/Rebilly/ReDoc/blob/63ae2e8e943b1cf2838db20c6c567156a2bfac45/src/theme.ts#L35
Theme can't be used on
<redoc>tag attributes yet.Feel free to ask additional question!