mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add config to include custom CSS
Summary: Adds a new environment variable that allows for custom CSS to be included in all core static pages. Test Plan: Tested manually in grist-core. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3419
This commit is contained in:
@@ -29,6 +29,9 @@ export interface ICreate {
|
||||
sessionSecret(): string;
|
||||
// Get configuration information to show at start-up.
|
||||
configurationOptions(): {[key: string]: any};
|
||||
// Return a string containing 1 or more HTML tags to insert into the head element of every
|
||||
// static page.
|
||||
getExtraHeadHtml?(): string;
|
||||
}
|
||||
|
||||
export interface ICreateActiveDocOptions {
|
||||
@@ -90,6 +93,13 @@ export function makeSimpleCreator(opts: {
|
||||
if (config) { return config; }
|
||||
}
|
||||
return {};
|
||||
}
|
||||
},
|
||||
getExtraHeadHtml() {
|
||||
let customHeadHtmlSnippet = '';
|
||||
if (process.env.APP_STATIC_INCLUDE_CUSTOM_CSS === 'true') {
|
||||
customHeadHtmlSnippet += '<link rel="stylesheet" href="custom.css">';
|
||||
}
|
||||
return customHeadHtmlSnippet;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user