redoc icon indicating copy to clipboard operation
redoc copied to clipboard

Document theme options in readme

Open imnotashrimp opened this issue 8 years ago • 13 comments

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 avatar Jun 01 '18 14:06 imnotashrimp

@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!

RomanHotsiy avatar Jun 01 '18 14:06 RomanHotsiy

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 avatar Jun 08 '18 09:06 jjylha

@jjylha, yes, you've got it correctly.

RomanHotsiy avatar Jun 18 '18 09:06 RomanHotsiy

@imnotashrimp Any updates on this?

ShaneGMamet avatar Nov 26 '18 22:11 ShaneGMamet

Following

KimThibault avatar Jan 29 '19 21:01 KimThibault

Following

adeelibr avatar Aug 26 '19 11:08 adeelibr

Following

AlbertSuarez avatar Sep 17 '19 15:09 AlbertSuarez

Following

sid22 avatar Oct 22 '19 12:10 sid22

PR for this opened here https://github.com/Redocly/redoc/pull/1438

kscheirer avatar Oct 27 '20 18:10 kscheirer

PR was merged, I think this ticket can be closed.

kscheirer avatar Jan 20 '21 22:01 kscheirer

I am a bit confused. From https://github.com/Redocly/redoc#tldr, how do I apply https://github.com/Redocly/redoc#redoc-theme-object ?

rbruggem avatar May 18 '21 17:05 rbruggem

@RomanHotsiy , hello

Can be used on tag attributes?

siarhei-kurhuzenkau-idf avatar Nov 05 '21 07:11 siarhei-kurhuzenkau-idf

Documentation for the configuration, including theme options, has been updated. Find it here: https://redocly.com/docs/redoc/config/

lornajane avatar Nov 09 '23 18:11 lornajane