Skip to content

Commit cdd2eab

Browse files
committed
Release 0.15
1 parent 525cba5 commit cdd2eab

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
0.15.0 (2021-05-23)
5+
-------------------
6+
7+
* Small BC break: setting custom stylesheets no longer removes the 'theme'
8+
stylesheets. To remove the default theme, set `null` for theme.
9+
10+
411
0.14.11 (2021-05-23)
512
--------------------
613

src/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,7 @@ function normalizeOptions(options?: Partial<Options>): Options {
196196
const defaults = {
197197
title: 'API Browser',
198198
theme: defaultTheme,
199-
stylesheets: [
200-
`themes/${options.theme||defaultTheme}/main.css`,
201-
`themes/${options.theme||defaultTheme}/highlight.css`
202-
],
199+
203200
defaultLinks: [
204201
{
205202
href: '/',
@@ -239,6 +236,15 @@ function normalizeOptions(options?: Partial<Options>): Options {
239236
}
240237
}
241238

242-
return Object.assign(defaults, options) as Options;
239+
const newOptions:Options = Object.assign(defaults, options) as Options;
240+
241+
if (newOptions.theme !== null) {
242+
newOptions.stylesheets.push(
243+
`themes/${newOptions.theme}/main.css`,
244+
`themes/${newOptions.theme}/highlight.css`
245+
);
246+
}
247+
248+
return newOptions;
243249

244250
}

src/types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ export type Options = {
1616
*
1717
* Possible options: spicy-oj, lfo, curveball
1818
*/
19-
theme: 'spicy-oj' | 'lfo' | 'curveball' | 'xmas';
19+
theme: 'spicy-oj' | 'lfo' | 'curveball' | 'xmas' | null;
2020

2121
/**
2222
* List of custom stylesheets to embed.
23-
*
24-
* Note that setting this will cause 'theme' to be ignored.
2523
*/
2624
stylesheets: string[];
2725

0 commit comments

Comments
 (0)