Hello,
I have a questions about Themes. Can you help me?
-
How to set theme what user selected from the dropdown as default? And how to change dropdown items order?
-
How to create new theme with new name? I mean…press on some button like "create new theme" then it will copy all variables from the selected theme and user can set new theme name, change theme and save it. This theme will be added to the dropdown with themes.
-
How to set "default" theme as readonly?
-
We have brand styles and I changed default theme. I've added new theme json and applied it to survey. But I see behavior like…user goes to themes tab and selects some other theme then he selects back the default theme and this theme is not in brand styles it has default survey values. How can I fix it?
Hello Anton,
Thank you for reaching out to us.
You can save the name of a user selected theme and apply it on the second survey creator run. To load a theme to a survey creator, assign a theme object to Survey Creator's
theme
property.A list of themes displayed within the Theme dropdown is determined by the
PredefinedThemes
object from"survey-creator-core"
module. PredefinedThemes is an array of theme names available within a Survey Creator. You can rearrange items within this array. For instance, the following code sorts theme names in ascending order:import { PredefinedThemes } from "survey-creator-core"; PredefinedThemes.sort();
Please refer to my reply in the following ticket for step-by-step instructions on how to programmatically define a custom theme and add it to a list of themes: Add custom theme in theme's list.
View Demo
Would you please expand on this task. Do you wish to prevent users from modifying the Default theme?
From what I gather, you implemented a custom theme and assigned it to a survey creator's
theme
property. Now, you wish to apply your custom theme when a user selects the Default theme in a list. Please confirm that.Would you please expand on this task. Do you wish to prevent users from modifying the Default theme? -yes. Default theme will be as a some fundamental. And User can create new theme using default (press on some button like "copy styles and create new theme" but he can not change default theme.
From what I gather, you implemented a custom theme and assigned it to a survey creator's
theme
property. Now, you wish to apply your custom theme when a user selects the Default theme in a list. Please confirm that. - Not certainly in that way. I've changed survey default theme to follow our styles. But behavior like that…you can see it on your example. Open this page https://surveyjs.io/survey-creator/examples/change-form-theme/reactjs. Select some theme (not default). Go back to default theme. And check for example "Accent color" - it was changed. Expected (and this is my question) - "accent color" should be the same as it was and maybe some other settings (I didn't check all of them).Hello Anton,
Thank you for the update. I appreciate your clarification.
The first task is clear.
Regarding the second task: it seems that you confirmed my assumptions. Please correct me if I'm wrong. You modified the Default theme and assigned a custom theme to
creator.theme
. Is that correct? Now, when a user activates the Themes tab, they see a customized theme and the Default theme selected within a list. However, if they change the theme and get back to Default, they'll actually see the Default theme colors, rather than your customized theme. So the question is how to modify the Default theme and allow users to apply a customized branded theme by selecting the Default item.To summarize, you would like to achieve the following tasks:
I'll discuss these tasks with the development team. Please give me additional time. I'll update you as soon as I get any news.
Thanks