Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: CSS overrides mechanism #6

Open
flowt-au opened this issue Dec 3, 2018 · 2 comments
Open

Suggestion: CSS overrides mechanism #6

flowt-au opened this issue Dec 3, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@flowt-au
Copy link

flowt-au commented Dec 3, 2018

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

@tsv2013
Copy link
Member

tsv2013 commented Dec 5, 2018

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

@tsv2013 tsv2013 added the enhancement New feature or request label Dec 5, 2018
@flowt-au
Copy link
Author

flowt-au commented Dec 5, 2018

:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants