Can I use my css file instead of using SurveyJs css for rendering the survey questions?
Can we use our inbuilt app css instead of using SurveyJs css?? To decorate questions and the columns and rows
Answers approved by surveyjs Support
Hello Abhishek,
Yes, you can apply custom CSS to survey elements.
The SurveyModel
object raises events that allow you to override CSS classes for individual questions, panels, pages, and choice items. Refer to the following event descriptions in the API reference for more information:
You can also customize colors using CSS variables: Theme Customization.
For more information, check the following guide: Themes & Styles.
Please let me know if you have any questions or require further assistance.
Hi Jane,
Here my question was instead of using the SurveyJs css I want to use my application CSS and not the SurveyModel events. Is that possible to use pure custom css to display the form in our own way?
Hello Abhishek,
Yes, it is possible.
Survey element appearance is defined by a selected theme. However, you can override theme CSS and apply your own CSS.
If you want to apply custom CSS classes to all survey elements of a specific type, define a JavaScript object in which keys specify survey elements and values specify CSS classes. Finally, assign this object to SurveyModel
's css
property. An example is available at https://surveyjs.io/form-library/examples/survey-customcss/angular.
For information on the object structure, refer to the following file on GitHub: defaultV2Css.ts.
Let me know if any questions remain.