diff --git a/app/client/tsconfig.json b/app/client/tsconfig.json index c789f31a..403d97da 100644 --- a/app/client/tsconfig.json +++ b/app/client/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../buildtools/tsconfig-base.json", "references": [ - { "path": "../common" } + { "path": "../common" }, + { "path": "../../stubs/app" }, ] } diff --git a/app/client/ui2018/cssVars.ts b/app/client/ui2018/cssVars.ts index a55a0194..f5f73b36 100644 --- a/app/client/ui2018/cssVars.ts +++ b/app/client/ui2018/cssVars.ts @@ -6,7 +6,7 @@ * 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 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)); document.documentElement!.classList.add(cssRoot.className); document.body.classList.add(cssBody.className); + const theme = getTheme(productFlavor); + if (theme.bodyClassName) { + document.body.classList.add(theme.bodyClassName); + } } diff --git a/buildtools/tsconfig-base.json b/buildtools/tsconfig-base.json index d32557f9..be751b6b 100644 --- a/buildtools/tsconfig-base.json +++ b/buildtools/tsconfig-base.json @@ -16,6 +16,7 @@ "*": [ "*", "grist-core/*", + "stubs/*" ], }, "composite": true, diff --git a/buildtools/webpack.config.js b/buildtools/webpack.config.js index 3540cb13..7533bb73 100644 --- a/buildtools/webpack.config.js +++ b/buildtools/webpack.config.js @@ -34,6 +34,7 @@ module.exports = { resolve: { modules: [ path.resolve('./_build'), + path.resolve('./_build/stubs'), path.resolve('./node_modules') ], }, diff --git a/stubs/app/client/ui/CustomThemes.ts b/stubs/app/client/ui/CustomThemes.ts new file mode 100644 index 00000000..bbf8d591 --- /dev/null +++ b/stubs/app/client/ui/CustomThemes.ts @@ -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 { + }; +} diff --git a/stubs/app/tsconfig.json b/stubs/app/tsconfig.json new file mode 100644 index 00000000..0321f87a --- /dev/null +++ b/stubs/app/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../buildtools/tsconfig-base.json", + "references": [ + { "path": "../../app/common" } + ] +} diff --git a/tsconfig.json b/tsconfig.json index fc1cab4b..e6cbb2db 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "include": [], "references": [ { "path": "./app" }, + { "path": "./stubs/app" }, // { "path": "./test" }, ] }