Skip to content
Snippets Groups Projects
Commit f2375b61 authored by Anthony's avatar Anthony
Browse files

Use theme css variable in survey

parent 8a69c73f
Branches
No related tags found
1 merge request!4Resolve "Démo/Réunion du 16/01 avec Laurence et Sheridan"
......@@ -106,8 +106,15 @@ $(function () {
innerCss: "sd-btn nav-input"
});
// Ugly tricks to avoid to create a new theme
const customTheme = SurveyTheme.DefaultLightPanelless;
const primColor = getComputedStyle(document.documentElement,null).getPropertyValue('--macao-primary-color');
customTheme.cssVariables["--sjs-primary-backcolor"] = primColor;
customTheme.cssVariables["--sjs-primary-backcolor-dark"] = primColor;
// Apply theme
survey.applyTheme(SurveyTheme.DefaultLightPanelless);
console.log("Survey theme applied", SurveyTheme.DefaultLightPanelless);
// Inflate the survey in the page
$("#surveyContainer").Survey({ model: survey });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment