mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
freshen app/client/ui2018/cssVars.ts
The cssVars.ts file has changed to include some more knobs for custom theming. This commit updates the file, and introduces a `stubs` directory for stubbing code that is specific to our deployments of Grist and not of general interest.
This commit is contained in:
parent
ad35f54b87
commit
c8c5afbbca
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../buildtools/tsconfig-base.json",
|
"extends": "../../buildtools/tsconfig-base.json",
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../common" }
|
{ "path": "../common" },
|
||||||
|
{ "path": "../../stubs/app" },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* https://css-tricks.com/snippets/css/system-font-stack/
|
* https://css-tricks.com/snippets/css/system-font-stack/
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import {ProductFlavor} from 'app/common/gristUrls';
|
import {getTheme, ProductFlavor} from 'app/client/ui/CustomThemes';
|
||||||
import {dom, makeTestId, styled, TestId} from 'grainjs';
|
import {dom, makeTestId, styled, TestId} from 'grainjs';
|
||||||
import values = require('lodash/values');
|
import values = require('lodash/values');
|
||||||
|
|
||||||
@ -160,4 +160,8 @@ export function attachCssRootVars(productFlavor: ProductFlavor, varsOnly: boolea
|
|||||||
dom.update(document.documentElement!, varsOnly ? dom.cls(cssVarsOnly.className) : dom.cls(cssRootVars));
|
dom.update(document.documentElement!, varsOnly ? dom.cls(cssVarsOnly.className) : dom.cls(cssRootVars));
|
||||||
document.documentElement!.classList.add(cssRoot.className);
|
document.documentElement!.classList.add(cssRoot.className);
|
||||||
document.body.classList.add(cssBody.className);
|
document.body.classList.add(cssBody.className);
|
||||||
|
const theme = getTheme(productFlavor);
|
||||||
|
if (theme.bodyClassName) {
|
||||||
|
document.body.classList.add(theme.bodyClassName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"*": [
|
"*": [
|
||||||
"*",
|
"*",
|
||||||
"grist-core/*",
|
"grist-core/*",
|
||||||
|
"stubs/*"
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"composite": true,
|
"composite": true,
|
||||||
|
@ -34,6 +34,7 @@ module.exports = {
|
|||||||
resolve: {
|
resolve: {
|
||||||
modules: [
|
modules: [
|
||||||
path.resolve('./_build'),
|
path.resolve('./_build'),
|
||||||
|
path.resolve('./_build/stubs'),
|
||||||
path.resolve('./node_modules')
|
path.resolve('./node_modules')
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
12
stubs/app/client/ui/CustomThemes.ts
Normal file
12
stubs/app/client/ui/CustomThemes.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
export type ProductFlavor = string;
|
||||||
|
|
||||||
|
// TODO: move CustomTheme type outside of stub code
|
||||||
|
export interface CustomTheme {
|
||||||
|
bodyClassName?: string;
|
||||||
|
wideLogo?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function getTheme(flavor: string): CustomTheme {
|
||||||
|
return {
|
||||||
|
};
|
||||||
|
}
|
6
stubs/app/tsconfig.json
Normal file
6
stubs/app/tsconfig.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../buildtools/tsconfig-base.json",
|
||||||
|
"references": [
|
||||||
|
{ "path": "../../app/common" }
|
||||||
|
]
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
"include": [],
|
"include": [],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "./app" },
|
{ "path": "./app" },
|
||||||
|
{ "path": "./stubs/app" },
|
||||||
// { "path": "./test" },
|
// { "path": "./test" },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user