File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 11Changelog
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+
4110.14.11 (2021-05-23)
512--------------------
613
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments