Question T15515
Visible to All Users

Themes questions

created a year ago

Hello,

Can you help me with themes?
I have questions:

  1. How to add dark and lite custom theme? I've added light but dark doesn't work.
  2. How to merge save theme and save survey buttons to one button? (save event and modified state)

And one more question. How to hide "please purchase license" message? I see it after I updated to the latest survey version.

Thanks,
Anton

Comments (2)

    Hello Anton,
    Thank you for your questions.
    The Light and Dark setting is a special colorPalette theme setting which defines which color palette will be applied to a theme. However, the color palette setting is not specific to a particular survey theme, but is preserved when a user selects another theme from a list. I will discuss a possible option to build a custom Dark theme and preserve the palette setting for the custom theme only. Please stay tuned.

    To process them in the most efficient manner, I separated them in different tickets:

    Please refer to them for further details.

      I've changed the Default theme

      TypeScript
      SurveyCreatorCore.Themes.cd_default = themeJSON.cssVariables; SurveyCreatorCore.PredefinedThemes.shift(); SurveyCreatorCore.PredefinedThemes.push("cd_default"); SurveyCreatorCore.PredefinedThemes.splice(0, 0, SurveyCreatorCore.PredefinedThemes.pop() as string);

      When user clicks on Dark theme or on Without Panels then he sees an error
      Clipboard-File-1.png

      Thanks,
      Anton

      Answers approved by surveyjs Support

      created a year ago

      Hello Anton,

      We approved the theme builder API, and I've prepared this live example for you - https://plnkr.co/edit/3Rv9TMSOmdzXNJWL
      The example demonstrates how to:

      • add a custom theme with human-readable title for theme chooser dropdown
      • add a custom theme with dark/light modifications
      • add "Save theme" button to save a custom theme based on current theme modifications
      • add "Delete theme" button to delete previously added custom theme

      Hope you'll find it helpful. Your feedback is highly appreciated.

      Thanks, Serge
      SurveyJS Team

        created a year ago

        Hello Anton,

        I've created this PR https://github.com/surveyjs/survey-creator/pull/4896 to address the following cases:

        • support custom theme variations functionality (How to add dark and light custom theme?)
        • combine save survey and save theme actions functionality (How to merge save theme and save survey buttons to one button?)

        As soon as it will be discussed, tested, approved and merged we can create and publish an example how to use these features.
        I believe it will be included in the nearest minor update released next week.

        Thanks, Serge
        SurveyJS Team

          Other Answers

          created a year ago

          Also if theme was changed and user pressed on save button then I save this theme as Custom theme and I'm adding this theme to themes dropdown
          Clipboard-File-1.png

          And the behavior is the same as for custom default theme what I mentioned before. (I mean the same errors)

          Thanks,
          Anton