Skip to content

Commit

Permalink
IDefaultTheme => IRecoveryTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
afshin committed May 21, 2018
1 parent 7060968 commit 42f158e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 16 deletions.
14 changes: 14 additions & 0 deletions packages/apputils/src/thememanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ import {


/* tslint:disable */
/**
* The application recovery theme token.
*/
export
const IRecoveryTheme = new Token('@jupyterlab/apputils:IRecoveryTheme');


/**
* The application recovery theme interface.
*/
export
interface IRecoveryTheme {}


/**
* The theme manager token.
*/
Expand Down
10 changes: 3 additions & 7 deletions packages/theme-dark-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ import {
const plugin: JupyterLabPlugin<void> = {
id: '@jupyterlab/theme-dark-extension:plugin',
requires: [IThemeManager],
activate: function(app: JupyterLab, manager: IThemeManager) {
activate: (app: JupyterLab, manager: IThemeManager) => {
manager.register({
name: 'JupyterLab Dark',
load: function() {
return manager.loadCSS('@jupyterlab/theme-dark-extension/index.css');
},
unload: function() {
return Promise.resolve(void 0);
}
load: () => manager.loadCSS('@jupyterlab/theme-dark-extension/index.css'),
unload: () => Promise.resolve(undefined)
});
},
autoStart: true
Expand Down
36 changes: 27 additions & 9 deletions packages/theme-light-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,47 @@ import {
} from '@jupyterlab/application';

import {
IThemeManager
IRecoveryTheme, IThemeManager
} from '@jupyterlab/apputils';


/**
* The Jupyter Light Theme stylesheet.
*/
const style = '@jupyterlab/theme-light-extension/index.css';


/**
* A plugin for the Jupyter Light Theme.
*/
const plugin: JupyterLabPlugin<void> = {
const theme: JupyterLabPlugin<void> = {
id: '@jupyterlab/theme-light-extension:plugin',
requires: [IThemeManager],
activate: function(app: JupyterLab, manager: IThemeManager) {
manager.register({
name: 'JupyterLab Light',
load: function() {
return manager.loadCSS('@jupyterlab/theme-light-extension/index.css');
},
unload: function() {
return Promise.resolve(void 0);
}
load: () => manager.loadCSS(style),
unload: () => Promise.resolve(undefined)
});
},
autoStart: true
};


export default plugin;
/**
* A plugin for the Jupyter Light Theme.
*/
const recoveryTheme: JupyterLabPlugin<IRecoveryTheme> = {
id: '@jupyterlab/theme-light-extension:recovery',
requires: [IThemeManager],
activate: (app: JupyterLab, manager: IThemeManager) => manager.loadCSS(style),
autoStart: true,
provides: IRecoveryTheme
};


/**
* Export the plugins as default.
*/
const plugins: JupyterLabPlugin<any>[] = [theme, recoveryTheme];
export default plugins;

0 comments on commit 42f158e

Please sign in to comment.