theme: add new editorSidebar scope

This commit is contained in:
Abdullah Atta
2023-08-02 13:09:30 +05:00
parent f222327a89
commit bd9e997ef1
2 changed files with 9 additions and 4 deletions

View File

@@ -132,6 +132,10 @@ export type ThemeScopes = {
* Scope specific to the Editor Toolbar.
*/
editorToolbar?: PartialVariants;
/**
* Scope for all the Editor side bars include note properties, attachment previews etc.
*/
editorSidebar?: PartialVariants;
/**
* Scope for all the dialogs in the app.
*/
@@ -268,15 +272,16 @@ export const StaticColors = {
white: "#ffffff"
} as const;
export const ThemeScopeKeys: readonly (keyof ThemeScopes)[] = [
export const THEME_SCOPES: readonly (keyof ThemeScopes)[] = [
"base",
"statusBar",
"list",
"editor",
"editorToolbar",
"editorSidebar",
"dialog",
"navigationMenu",
"contextMenu",
"editorToolbar",
"sheet"
];

View File

@@ -22,7 +22,7 @@ import {
PreviewColors,
StaticColors,
ThemeDefinition,
ThemeScopeKeys,
THEME_SCOPES,
ThemeScopes,
Variants,
VariantsWithStaticColors
@@ -64,7 +64,7 @@ export function getPreviewColors(theme: ThemeDefinition): PreviewColors {
export function themeToCSS(theme: ThemeDefinition) {
const css: string[] = [];
for (const scopeKey of ThemeScopeKeys) {
for (const scopeKey of THEME_SCOPES) {
const scope = theme.scopes[scopeKey] || {};
const variants = buildVariants(scopeKey, theme, scope);