surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.09k stars 795 forks source link

How can I apply the default V2 creator theme to my survey #3799

Open alshehrio opened 2 years ago

alshehrio commented 2 years ago

Are you requesting a feature, reporting a bug or asking a question?

asking a question

What is the current behavior?

I can not make the survey render with the same theme I see in the "test survey" tab in the V2 survey creator.

What is the expected behavior?

The resulting survey from the survey creator should look like what the user saw while creating the survey.

How would you reproduce the current behavior (if this is a bug)?

  1. create a survey using the V2 survey creator
  2. click on the "test survey" tab and observe the look and feel of the survey.
  3. publish the survey
  4. render the survey using the survey library and observe the difference in the look and feel between the two.

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code

your_code_here

Specify your

Please find attached a screen shots of the diffrances

survey creator v2 result survey library result

Thanks a lot for the great work

andrewtelnov commented 2 years ago

@alshehrio You need to replace "modern.min.css" in your link with "defaultV2.min.css" and then Survey.StylesManager .applyTheme("modern"); vs Survey.StylesManager .applyTheme("defaultV2"); Here is the example.

PS: I assume you have a developer license to have a right using SurveyJS Creator in your web apps ;-)

Thank you, Andrew

alshehrio commented 2 years ago

Thanks for your reply.

Adding survey-core to my dependences and then importing "defaultV2.min.css" from it messes up the survey creator styling. However, I copied "defaultV2.min.css" to my project and imported it into my survey viewer component and it worked perfectly.

Regarding the creator license, we are still evaluating the project. But based on our experience so far, we like what we see ;-)