add Sass support to include and override SurveyJS styles

This commit is contained in:
bjoluc 2021-11-28 23:05:33 +01:00
parent 25a4732c47
commit fc92e40248
5 changed files with 968 additions and 6 deletions

949
package-lock.json generated

File diff suppressed because it is too large Load Diff

2
packages/plugin-survey/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
css/survey.css
css/survey.css.map

View File

@ -0,0 +1,10 @@
@use "survey-knockout/survey.css";
.sv_main {
font-family: "Open Sans", "Arial", sans-serif;
font-size: 18px;
.sv_body {
border-top-width: 0;
}
}

View File

@ -5,8 +5,7 @@
<script src="../jspsych/dist/index.browser.js"></script>
<script src="./dist/index.browser.js"></script>
<link rel="stylesheet" href="../jspsych/css/jspsych.css" />
<!-- <link rel="stylesheet" href="css/plugin-survey.css" /> -->
<link rel="stylesheet" href="https://unpkg.com/survey-core@1.8.78/survey.css" />
<link rel="stylesheet" href="css/survey.css" />
</head>
<body></body>
<script type="text/javascript">

View File

@ -19,8 +19,10 @@
"test": "jest",
"test:watch": "npm test -- --watch",
"tsc": "tsc",
"build": "rollup --config",
"build:watch": "npm run build -- --watch"
"build:js": "rollup --config",
"build:styles": "sass --load-path ../../node_modules css/survey.scss css/survey.css",
"build": "run-p build:js build:styles",
"build:watch": "run-p \"build:js -- --watch\" \"build:styles -- --watch\""
},
"repository": {
"type": "git",
@ -38,7 +40,9 @@
},
"devDependencies": {
"@jspsych/config": "^1.0.0",
"@jspsych/test-utils": "^1.0.0"
"@jspsych/test-utils": "^1.0.0",
"npm-run-all": "^4.1.5",
"sass": "^1.43.5"
},
"dependencies": {
"survey-knockout": "^1.8.78"