Skip to content

Suggestion: CSS overrides mechanism #6

@flowt-au

Description

@flowt-au

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions