1.0.3 • Published 1 year ago

redark-theme v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

redark

A dark theme for Redoc

Check out this demo!

Installation

First, install from npm:

$ npm i redark-theme

Then, add the script and stylesheet from node_modules to your HTML:

<link rel="stylesheet" href="node_modules/redark-theme/redark.css" />

<script src="node_modules/redark-theme/redark.js"></script>

Finally, initialize Redoc with the redark theme:

<body>
  <div id="redoc-container"></div>
  <script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
  <script>
    Redoc.init(
      'url/to/your/spec',
      { theme: redark },
      document.getElementById('redoc-container')
    );
  </script>
</body>

You can also access the theme object in JavaScript:

import { theme } from 'redark-theme';

// use with the Redoc React component or something