mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
theme: add new editorSidebar scope
This commit is contained in:
@@ -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"
|
||||
];
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user