surveyjs-wordpress icon indicating copy to clipboard operation
surveyjs-wordpress copied to clipboard

Suggestion: CSS overrides mechanism

Open flowt-au opened this issue 7 years ago • 2 comments

Thanks for the plugin. Very helpful.

I needed to set some CSS to override the WP theme and to better format the matrix tables I am using. I did that by adding the following to surveyjs/survey.css directly via the WP plugin file editor, which obviously has a downside if I update the SurveyJS plugin.

.main_color tr:nth-child(2n) { background-color: #f8f8f8 !important; }
.sv_header { background-color:#75e3b0; }
.sv_q_matrix tr th:first-child{ text-align:left !important; }
.sv_q_matrix tr td:first-child{ text-align:left !important; }
.sv_q_matrix th { text-align:center !important; }
.sv_q_matrix td { text-align:center !important; }

I was wondering whether you might consider adding some php to look for (say) surveyjs/custom.css and load it if the file exists. I am assuming the WP update process would not delete all files so this would remain in effect after any update.

I could envisage a similar JS file that could be called as a hook immediately before the

jQuery("#surveyElement-<?php echo $id ?>").Survey({model: survey<?php echo $id ?>, css: customCss});

passing the model JSON so last minute customisations could be done. eg to add other event listeners hooking into custom js code.

Just a thought to make this even more useful than it is!

Thanks, Murray

flowt-au avatar Dec 03 '18 21:12 flowt-au

Thank you for the suggestion. We'll keep it in mind.

tsv2013 avatar Dec 05 '18 08:12 tsv2013

:-)

flowt-au avatar Dec 05 '18 08:12 flowt-au