Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… Settings. Custom colors.
  • Loading branch information
OlgaLarina committed Oct 23, 2024
1 parent 0c27af5 commit 801dfa3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class CreatorThemeModel extends Base implements ICreatorTheme {
}

private blockThemeChangedNotifications = 0;
public loadTheme(theme: ICreatorTheme = {}) {
public loadTheme(theme: ICreatorTheme = { themeName: CreatorThemeModel.defautlThemeName }) {
this.blockThemeChangedNotifications += 1;
try {
const baseTheme = CreatorThemes[theme.themeName] || {};
Expand Down
27 changes: 17 additions & 10 deletions packages/survey-creator-core/src/creator-theme/creator-themes.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import { assign } from "../utils/utils";
import designTabSurveyThemeJSON from "../designTabSurveyThemeJSON";

export interface ICreatorTheme {
themeName?: string;
cssVariables?: { [index: string]: string };
}

export const PredefinedCreatorThemes: string[] = ["sc2020"];
const sc2020CssVariables = {};
assign(sc2020CssVariables, designTabSurveyThemeJSON.cssVariables, {
"--sjs-special-background": "#F3F3F3FF",
"--sjs-primary-background-500": "#19B394FF",
"--sjs-primary-background-10": "#19B3941A",
"--sjs-primary-background-400": "#14A48BFF",
"--sjs-secondary-background-500": "#FF9814FF",
"--sjs-secondary-background-25": "#FF981440",
"--sjs-secondary-background-10": "#FF98141A",
"--ctr-surface-background-color": "var(--sjs-special-background)",
"--ctr-toolbox-background-color": "var(--sjs-special-background)",
});

export const CreatorThemes: { [index: string]: ICreatorTheme } = {
"sc2020": {
themeName: "sc2020",
cssVariables: {
"--sjs-special-background": "#F3F3F3FF",
"--sjs-primary-background-500": "#19B394FF",
"--sjs-primary-background-10": "#19B3941A",
"--sjs-primary-background-400": "#14A48BFF",
"--sjs-secondary-background-500": "#FF9814FF",
"--sjs-secondary-background-25": "#FF981440",
"--sjs-secondary-background-10": "#FF98141A",
"--ctr-surface-background-color": "var(--sjs-special-background)",
}
cssVariables: sc2020CssVariables
}
};

0 comments on commit 801dfa3

Please sign in to comment.