Implement stylelint

This commit is contained in:
Matt Triff 2021-12-19 17:43:03 -05:00
parent 70397fd89a
commit 9835eb756a
14 changed files with 1510 additions and 15211 deletions

View File

@ -39,3 +39,6 @@ jobs:
# run: | # run: |
# npm run js:build # npm run js:build
# npx eslint --no-ignore ./public/assets/scripts/*.js # npx eslint --no-ignore ./public/assets/scripts/*.js
- name: run stylelint
run: npm run lint:scss

6
.stylelintrc.json Normal file
View File

@ -0,0 +1,6 @@
{
"extends": "stylelint-config-standard-scss",
"rules": {
"declaration-block-no-redundant-longhand-properties": null
}
}

View File

@ -62,5 +62,11 @@
], ],
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true "source.fixAll.eslint": true
} },
"stylelint.validate": [
"css",
"less",
"postcss",
"scss"
]
} }

16487
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,9 @@
"scripts": { "scripts": {
"start": "run-p js:watch css:watch", "start": "run-p js:watch css:watch",
"build": "run-p js:build css:build", "build": "run-p js:build css:build",
"lint": "eslint src/scripts/**/*.ts", "lint": "run-p lint:js lint:scss",
"lint:js": "eslint src/scripts/**/*.ts",
"lint:scss": "stylelint src/**/*.scss",
"bundlesize": "bundlesize", "bundlesize": "bundlesize",
"cypress:run": "cypress run --browser chrome", "cypress:run": "cypress run --browser chrome",
"cypress:open": "cypress open", "cypress:open": "cypress open",
@ -93,6 +95,9 @@
"sass": "^1.45.0", "sass": "^1.45.0",
"sinon": "^12.0.1", "sinon": "^12.0.1",
"sinon-chai": "^3.7.0", "sinon-chai": "^3.7.0",
"stylelint": "^14.1.0",
"stylelint-config-standard": "^24.0.0",
"stylelint-config-standard-scss": "^3.0.0",
"ts-loader": "^9.2.6", "ts-loader": "^9.2.6",
"ts-node": "^10.4.0", "ts-node": "^10.4.0",
"typescript": "^4.5.4", "typescript": "^4.5.4",

View File

@ -1,14 +1,14 @@
/*============================================= /* =============================================
= Generic styling = = Generic styling =
=============================================*/ ============================================= */
* { * {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
*, *,
*:before, *::before,
*:after { *::after {
box-sizing: border-box; box-sizing: border-box;
} }
@ -24,7 +24,7 @@ body {
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 16px; font-size: 16px;
line-height: 1.4; line-height: 1.4;
color: #ffffff; color: #fff;
background-color: #333; background-color: #333;
overflow-x: hidden; overflow-x: hidden;
} }
@ -39,6 +39,7 @@ label {
p { p {
margin-top: 0; margin-top: 0;
margin-bottom: 8px;
} }
hr { hr {
@ -64,7 +65,7 @@ h6 {
a, a,
a:visited, a:visited,
a:focus { a:focus {
color: #ffffff; color: #fff;
text-decoration: none; text-decoration: none;
font-weight: 600; font-weight: 600;
} }
@ -78,7 +79,7 @@ a:focus {
border-radius: 2.5px; border-radius: 2.5px;
font-size: 14px; font-size: 14px;
-webkit-appearance: none; -webkit-appearance: none;
appearance: none; appearance: none;
margin-bottom: 24px; margin-bottom: 24px;
} }
@ -112,10 +113,6 @@ h6,
font-size: 14px; font-size: 14px;
} }
p {
margin-bottom: 8px;
}
label + p { label + p {
margin-top: -4px; margin-top: -4px;
} }
@ -133,7 +130,7 @@ label + p {
} }
.section { .section {
background-color: #ffffff; background-color: #fff;
padding: 24px; padding: 24px;
color: #333; color: #333;
} }
@ -148,7 +145,7 @@ label + p {
margin-bottom: 12px; margin-bottom: 12px;
} }
.logo__img { .logo-img {
width: 100%; width: 100%;
height: auto; height: auto;
display: inline-block; display: inline-block;
@ -181,4 +178,4 @@ label + p {
margin-bottom: 24px; margin-bottom: 24px;
} }
/*===== End of Section comment block ======*/ /* ===== End of Section comment block ====== */

View File

@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["../../../src/styles/base.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAYA;EACE;EACA;;;AAGF;AAAA;AAAA;EAGE;;;AAGF;AAAA;EAEE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EAME;EACA;EACA;EACA;;;AAGF;AAAA;AAAA;EAGE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,eAtFiB;;;AAyFnB;AAAA;EAEE,WA1FoB;;;AA6FtB;AAAA;EAEE,WA9FoB;;;AAiGtB;AAAA;EAEE,WAlGoB;;;AAqGtB;AAAA;EAEE,WAtGoB;;;AAyGtB;AAAA;EAEE,WA1GoB;;;AA6GtB;AAAA;EAEE,WA9GoB;;;AAiHtB;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;;AACA;EALF;IAMI;;;;AAIJ;EACE;EACA,SA3IiB;EA4IjB;;AACA;AAAA;AAAA;EAGE;;;AAIJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE,eAvKiB;;;AA0KnB;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE,eAvLiB;;;AA0LnB","file":"base.css"} {"version":3,"sourceRoot":"","sources":["../../../src/styles/base.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAYA;EACE;EACA;;;AAGF;AAAA;AAAA;EAGE;;;AAGF;AAAA;EAEE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EAME;EACA;EACA;EACA;;;AAGF;AAAA;AAAA;EAGE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,eAtFiB;;;AAyFnB;AAAA;EAEE,WA1FoB;;;AA6FtB;AAAA;EAEE,WA9FoB;;;AAiGtB;AAAA;EAEE,WAlGoB;;;AAqGtB;AAAA;EAEE,WAtGoB;;;AAyGtB;AAAA;EAEE,WA1GoB;;;AA6GtB;AAAA;EAEE,WA9GoB;;;AAiHtB;EACE;;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EANF;IAOI;;;;AAIJ;EACE;EACA,SAxIiB;EAyIjB;;AAEA;AAAA;AAAA;EAGE;;;AAIJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE,eArKiB;;;AAwKnB;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE,eArLiB;;;AAwLnB","file":"base.css"}

View File

@ -1 +1 @@
*{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,:after,:before{box-sizing:border-box}body,html{position:relative;margin:0;width:100%;height:100%}body{font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:16px;line-height:1.4;color:#fff;background-color:#333;overflow-x:hidden}hr,label{display:block}label,p{margin-bottom:8px}label{font-size:14px;font-weight:500;cursor:pointer}p{margin-top:0}hr{margin:30px 0;border:0;border-bottom:1px solid #eaeaea;height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:12px;font-weight:400;line-height:1.2}a,a:focus,a:visited{color:#fff;text-decoration:none;font-weight:600}.form-control{display:block;width:100%;background-color:#f9f9f9;padding:12px;border:1px solid #ddd;border-radius:2.5px;font-size:14px;-webkit-appearance:none;appearance:none;margin-bottom:24px}.h1,h1{font-size:32px}.h2,h2{font-size:24px}.h3,h3{font-size:20px}.h4,h4{font-size:18px}.h5,h5{font-size:16px}.h6,h6{font-size:14px}label+p{margin-top:-4px}.container{display:block;margin:auto;max-width:40em;padding:48px}@media (max-width:620px){.container{padding:0}}.section{background-color:#fff;padding:24px;color:#333}.section a,.section a:focus,.section a:visited{color:#00bcd4}.logo{display:block;margin-bottom:12px}.logo__img{width:100%;height:auto;display:inline-block;max-width:100%;vertical-align:top;padding:6px 0}.visible-ie{display:none}.push-bottom{margin-bottom:24px}.zero-bottom{margin-bottom:0}.zero-top{margin-top:0}.text-center{text-align:center}[data-test-hook]{margin-bottom:24px} *{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,::after,::before{box-sizing:border-box}body,html{position:relative;margin:0;width:100%;height:100%}body{font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:16px;line-height:1.4;color:#fff;background-color:#333;overflow-x:hidden}hr,label{display:block}label,p{margin-bottom:8px}label{font-size:14px;font-weight:500;cursor:pointer}p{margin-top:0}hr{margin:30px 0;border:0;border-bottom:1px solid #eaeaea;height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:12px;font-weight:400;line-height:1.2}a,a:focus,a:visited{color:#fff;text-decoration:none;font-weight:600}.form-control{display:block;width:100%;background-color:#f9f9f9;padding:12px;border:1px solid #ddd;border-radius:2.5px;font-size:14px;-webkit-appearance:none;appearance:none;margin-bottom:24px}.h1,h1{font-size:32px}.h2,h2{font-size:24px}.h3,h3{font-size:20px}.h4,h4{font-size:18px}.h5,h5{font-size:16px}.h6,h6{font-size:14px}label+p{margin-top:-4px}.container{display:block;margin:auto;max-width:40em;padding:48px}@media (max-width:620px){.container{padding:0}}.section{background-color:#fff;padding:24px;color:#333}.section a,.section a:focus,.section a:visited{color:#00bcd4}.logo{display:block;margin-bottom:12px}.logo-img{width:100%;height:auto;display:inline-block;max-width:100%;vertical-align:top;padding:6px 0}.visible-ie{display:none}.push-bottom{margin-bottom:24px}.zero-bottom{margin-bottom:0}.zero-top{margin-top:0}.text-center{text-align:center}[data-test-hook]{margin-bottom:24px}

View File

@ -1,6 +1,6 @@
/*=============================== /* ===============================
= Choices = = Choices =
===============================*/ =============================== */
.choices { .choices {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@ -40,12 +40,12 @@
display: block; display: block;
width: 100%; width: 100%;
padding: 10px; padding: 10px;
border-bottom: 1px solid #dddddd; border-bottom: 1px solid #ddd;
background-color: #ffffff; background-color: #fff;
margin: 0; margin: 0;
} }
.choices[data-type*=select-one] .choices__button { .choices[data-type*=select-one] .choices__button {
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==); background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==");
padding: 0; padding: 0;
background-size: 8px; background-size: 8px;
position: absolute; position: absolute;
@ -62,17 +62,17 @@
opacity: 1; opacity: 1;
} }
.choices[data-type*=select-one] .choices__button:focus { .choices[data-type*=select-one] .choices__button:focus {
box-shadow: 0px 0px 0px 2px #00bcd4; box-shadow: 0 0 0 2px #00bcd4;
} }
.choices[data-type*=select-one] .choices__item[data-value=""] .choices__button { .choices[data-type*=select-one] .choices__item[data-value=""] .choices__button {
display: none; display: none;
} }
.choices[data-type*=select-one]:after { .choices[data-type*=select-one]::after {
content: ""; content: "";
height: 0; height: 0;
width: 0; width: 0;
border-style: solid; border-style: solid;
border-color: #333333 transparent transparent transparent; border-color: #333 transparent transparent transparent;
border-width: 5px; border-width: 5px;
position: absolute; position: absolute;
right: 11.5px; right: 11.5px;
@ -80,11 +80,11 @@
margin-top: -2.5px; margin-top: -2.5px;
pointer-events: none; pointer-events: none;
} }
.choices[data-type*=select-one].is-open:after { .choices[data-type*=select-one].is-open::after {
border-color: transparent transparent #333333 transparent; border-color: transparent transparent #333 transparent;
margin-top: -7.5px; margin-top: -7.5px;
} }
.choices[data-type*=select-one][dir=rtl]:after { .choices[data-type*=select-one][dir=rtl]::after {
left: 11.5px; left: 11.5px;
right: auto; right: auto;
} }
@ -109,7 +109,7 @@
margin-left: 8px; margin-left: 8px;
padding-left: 16px; padding-left: 16px;
border-left: 1px solid #008fa1; border-left: 1px solid #008fa1;
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==); background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==");
background-size: 8px; background-size: 8px;
width: 8px; width: 8px;
line-height: 1; line-height: 1;
@ -128,7 +128,7 @@
width: 100%; width: 100%;
background-color: #f9f9f9; background-color: #f9f9f9;
padding: 7.5px 7.5px 3.75px; padding: 7.5px 7.5px 3.75px;
border: 1px solid #dddddd; border: 1px solid #ddd;
border-radius: 2.5px; border-radius: 2.5px;
font-size: 14px; font-size: 14px;
min-height: 44px; min-height: 44px;
@ -177,7 +177,7 @@
margin-bottom: 3.75px; margin-bottom: 3.75px;
background-color: #00bcd4; background-color: #00bcd4;
border: 1px solid #00a5bb; border: 1px solid #00a5bb;
color: #ffffff; color: #fff;
word-break: break-all; word-break: break-all;
box-sizing: border-box; box-sizing: border-box;
} }
@ -202,8 +202,8 @@
z-index: 1; z-index: 1;
position: absolute; position: absolute;
width: 100%; width: 100%;
background-color: #ffffff; background-color: #fff;
border: 1px solid #dddddd; border: 1px solid #ddd;
top: 100%; top: 100%;
margin-top: -1px; margin-top: -1px;
border-bottom-left-radius: 2.5px; border-bottom-left-radius: 2.5px;
@ -244,7 +244,7 @@
.choices__list--dropdown .choices__item--selectable { .choices__list--dropdown .choices__item--selectable {
padding-right: 100px; padding-right: 100px;
} }
.choices__list--dropdown .choices__item--selectable:after { .choices__list--dropdown .choices__item--selectable::after {
content: attr(data-select-text); content: attr(data-select-text);
font-size: 12px; font-size: 12px;
opacity: 0; opacity: 0;
@ -258,7 +258,7 @@
padding-left: 100px; padding-left: 100px;
padding-right: 10px; padding-right: 10px;
} }
[dir=rtl] .choices__list--dropdown .choices__item--selectable:after { [dir=rtl] .choices__list--dropdown .choices__item--selectable::after {
right: auto; right: auto;
left: 10px; left: 10px;
} }
@ -266,7 +266,7 @@
.choices__list--dropdown .choices__item--selectable.is-highlighted { .choices__list--dropdown .choices__item--selectable.is-highlighted {
background-color: #f2f2f2; background-color: #f2f2f2;
} }
.choices__list--dropdown .choices__item--selectable.is-highlighted:after { .choices__list--dropdown .choices__item--selectable.is-highlighted::after {
opacity: 0.5; opacity: 0.5;
} }
@ -296,7 +296,7 @@
.choices__button { .choices__button {
text-indent: -9999px; text-indent: -9999px;
-webkit-appearance: none; -webkit-appearance: none;
appearance: none; appearance: none;
border: 0; border: 0;
background-color: transparent; background-color: transparent;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -330,4 +330,4 @@
opacity: 0.5; opacity: 0.5;
} }
/*===== End of Choices ======*/ /* ===== End of Choices ====== */

View File

@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["../../../src/styles/choices.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAyBA;EACE;EACA;EACA,eApBkB;EAqBlB,WAxBqB;;AAyBrB;EACE;;AAEF;EACE;;AAEF;EACE;;AAGA;AAAA;EAEE,kBA9BsB;EA+BtB;EACA;;AAEF;EACE;;AAIJ;EACE;;;AAIJ;EACE;;AACA;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE,kBAhDyB;EAiDzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAEE;;AAEF;EACE;;AAGJ;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;;AAGA;EACE;EACA;;AAEF;EACE;EACA;EACA;EACA;;;AAOJ;AAAA;EACE;;AAEF;AAAA;EACE;EACA;EACA;EACA;EACA;EACA,aAnHoB;EAoHpB;EACA;EACA,kBArHiB;EAsHjB,iBAxHuB;EAyHvB,OAzHuB;EA0HvB;EACA;EACA;;AACA;AAAA;AAAA;EAEE;;;AAKN;EACE;EACA;EACA;EACA,kBAhJiB;EAiJjB;EACA;EACA,eArJsB;EAsJtB,WAzJqB;EA0JrB;EACA;;AACA;EAEE;;AAEF;EACE;;AAEF;EACE;;;AAIJ;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;AACA;EACE;EACA;;AAEF;EACE;;;AAIJ;EACE;;AACA;EACE;EACA;EACA,eA5LyB;EA6LzB;EACA,WAjMmB;EAkMnB;EACA;EACA;EACA,kBA5LoB;EA6LpB;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;EACA;;AAEF;EACE;EACA;;AAEF;EACE;EACA;;;AAKN;EACE;EACA,SA9MgB;EA+MhB;EACA;EACA,kBA3N0B;EA4N1B;EACA;EACA;EACA,2BAnOsB;EAoOtB,4BApOsB;EAqOtB;EACA;EACA;;AACA;EACE;;AAEF;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA,WAlQmB;;AAmQnB;EACE;;AAIF;EADF;IAEI;;EACA;IACE;IACA,WA3Qe;IA4Qf;IACA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;;EACA;IACE;IACA;;;AAIN;EACE;;AACA;EACE;;;AAMR;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA,WArTqB;EAsTrB;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;;AAIJ;EACE;EACA;EACA,kBAxUiB;EAyUjB,WA9UqB;EA+UrB;EACA;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;EACA;;;AAIJ;EACE;;;AAGF","file":"choices.css"} {"version":3,"sourceRoot":"","sources":["../../../src/styles/choices.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AA2BA;EACE;EACA;EACA,eApBkB;EAqBlB,WAxBqB;;AA0BrB;EACE;;AAGF;EACE;;AAGF;EACE;;AAIA;AAAA;EAEE,kBAlCsB;EAmCtB;EACA;;AAEF;EACE;;AAIJ;EACE;;;AAIJ;EACE;;AACA;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE,kBApDyB;EAqDzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;;AAGF;EACE;;AAGJ;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAIA;EACE;EACA;;AAEF;EACE;EACA;EACA;EACA;;;AAOJ;AAAA;EACE;;AAEF;AAAA;EACE;EACA;EACA;EACA;EACA;EACA,aA5HoB;EA6HpB;EACA;EACA,kBA9HiB;EA+HjB,iBAjIuB;EAkIvB,OAlIuB;EAmIvB;EACA;EACA;;AAEA;AAAA;AAAA;EAEE;;;AAKN;EACE;EACA;EACA;EACA,kBA1JiB;EA2JjB;EACA;EACA,eA/JsB;EAgKtB,WAnKqB;EAoKrB;EACA;;AAEA;EAEE;;AAGF;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;;;AAIJ;EACE;;AACA;EACE;EACA;EACA,eA1MyB;EA2MzB;EACA,WA/MmB;EAgNnB;EACA;EACA;EACA,kBA1MoB;EA2MpB;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;;;AAKN;EACE;EACA,SAhOgB;EAiOhB;EACA;EACA,kBA7O0B;EA8O1B;EACA;EACA;EACA,2BArPsB;EAsPtB,4BAtPsB;EAuPtB;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA,WAvRmB;;AAyRnB;EACE;;AAIF;EADF;IAEI;;EAEA;IACE;IACA,WAlSe;IAmSf;IACA;IACA;IACA;IACA;;EAGF;IACE;IACA;IACA;;EAEA;IACE;IACA;;;AAKN;EACE;;AAEA;EACE;;;AAMR;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA,WAhVqB;EAiVrB;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAIJ;EACE;EACA;EACA,kBAnWiB;EAoWjB,WAzWqB;EA0WrB;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;;AAIJ;EACE;;;AAGF","file":"choices.css"}

File diff suppressed because one or more lines are too long

View File

@ -74,7 +74,7 @@
<img <img
src="assets/images/logo.svg" src="assets/images/logo.svg"
alt="Choices.js logo" alt="Choices.js logo"
class="logo__img hidden-ie" class="logo-img hidden-ie"
/> />
<h1 class="visible-ie">Choices.js</h1> <h1 class="visible-ie">Choices.js</h1>
</a> </a>

View File

@ -1,6 +1,6 @@
/*============================================= /* =============================================
= Generic styling = = Generic styling =
=============================================*/ ============================================= */
$global-guttering: 24px; $global-guttering: 24px;
$global-font-size-h1: 32px; $global-font-size-h1: 32px;
@ -16,8 +16,8 @@ $global-font-size-h6: 14px;
} }
*, *,
*:before, *::before,
*:after { *::after {
box-sizing: border-box; box-sizing: border-box;
} }
@ -30,10 +30,10 @@ body {
} }
body { body {
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 16px; font-size: 16px;
line-height: 1.4; line-height: 1.4;
color: #ffffff; color: #fff;
background-color: #333; background-color: #333;
overflow-x: hidden; overflow-x: hidden;
} }
@ -48,6 +48,7 @@ label {
p { p {
margin-top: 0; margin-top: 0;
margin-bottom: 8px;
} }
hr { hr {
@ -73,7 +74,7 @@ h6 {
a, a,
a:visited, a:visited,
a:focus { a:focus {
color: #ffffff; color: #fff;
text-decoration: none; text-decoration: none;
font-weight: 600; font-weight: 600;
} }
@ -86,7 +87,6 @@ a:focus {
border: 1px solid #ddd; border: 1px solid #ddd;
border-radius: 2.5px; border-radius: 2.5px;
font-size: 14px; font-size: 14px;
-webkit-appearance: none;
appearance: none; appearance: none;
margin-bottom: $global-guttering; margin-bottom: $global-guttering;
} }
@ -121,10 +121,6 @@ h6,
font-size: $global-font-size-h6; font-size: $global-font-size-h6;
} }
p {
margin-bottom: 8px;
}
label + p { label + p {
margin-top: -4px; margin-top: -4px;
} }
@ -134,15 +130,17 @@ label + p {
margin: auto; margin: auto;
max-width: 40em; max-width: 40em;
padding: $global-guttering * 2; padding: $global-guttering * 2;
@media (max-width: 620px) { @media (max-width: 620px) {
padding: 0; padding: 0;
} }
} }
.section { .section {
background-color: #ffffff; background-color: #fff;
padding: $global-guttering; padding: $global-guttering;
color: #333; color: #333;
a, a,
a:visited, a:visited,
a:focus { a:focus {
@ -155,7 +153,7 @@ label + p {
margin-bottom: $global-guttering * 0.5; margin-bottom: $global-guttering * 0.5;
} }
.logo__img { .logo-img {
width: 100%; width: 100%;
height: auto; height: auto;
display: inline-block; display: inline-block;
@ -188,4 +186,4 @@ label + p {
margin-bottom: $global-guttering; margin-bottom: $global-guttering;
} }
/*===== End of Section comment block ======*/ /* ===== End of Section comment block ====== */

View File

@ -1,8 +1,10 @@
/*=============================== /* ===============================
= Choices = = Choices =
===============================*/ =============================== */
$choices-selector: 'choices' !default; @use "sass:color";
$choices-selector: "choices" !default;
$choices-font-size-lg: 16px !default; $choices-font-size-lg: 16px !default;
$choices-font-size-md: 14px !default; $choices-font-size-md: 14px !default;
$choices-font-size-sm: 12px !default; $choices-font-size-sm: 12px !default;
@ -11,16 +13,16 @@ $choices-border-radius: 2.5px !default;
$choices-border-radius-item: 20px !default; $choices-border-radius-item: 20px !default;
$choices-bg-color: #f9f9f9 !default; $choices-bg-color: #f9f9f9 !default;
$choices-bg-color-disabled: #eaeaea !default; $choices-bg-color-disabled: #eaeaea !default;
$choices-bg-color-dropdown: #ffffff !default; $choices-bg-color-dropdown: #fff !default;
$choices-text-color: #333333 !default; $choices-text-color: #333 !default;
$choices-keyline-color: #dddddd !default; $choices-keyline-color: #ddd !default;
$choices-primary-color: #00bcd4 !default; $choices-primary-color: #00bcd4 !default;
$choices-disabled-color: #eaeaea !default; $choices-disabled-color: #eaeaea !default;
$choices-highlight-color: $choices-primary-color !default; $choices-highlight-color: $choices-primary-color !default;
$choices-button-dimension: 8px !default; $choices-button-dimension: 8px !default;
$choices-button-offset: 8px !default; $choices-button-offset: 8px !default;
$choices-icon-cross: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==) !default; $choices-icon-cross: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==") !default;
$choices-icon-cross-inverse: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==) !default; $choices-icon-cross-inverse: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==") !default;
$choices-z-index: 1; $choices-z-index: 1;
.#{$choices-selector} { .#{$choices-selector} {
@ -28,15 +30,19 @@ $choices-z-index: 1;
overflow: hidden; overflow: hidden;
margin-bottom: $choices-guttering; margin-bottom: $choices-guttering;
font-size: $choices-font-size-lg; font-size: $choices-font-size-lg;
&:focus { &:focus {
outline: none; outline: none;
} }
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
&.is-open { &.is-open {
overflow: initial; overflow: initial;
} }
&.is-disabled { &.is-disabled {
.#{$choices-selector}__inner, .#{$choices-selector}__inner,
.#{$choices-selector}__input { .#{$choices-selector}__input {
@ -64,7 +70,7 @@ $choices-z-index: 1;
width: 100%; width: 100%;
padding: 10px; padding: 10px;
border-bottom: 1px solid $choices-keyline-color; border-bottom: 1px solid $choices-keyline-color;
background-color: #ffffff; background-color: #fff;
margin: 0; margin: 0;
} }
.#{$choices-selector}__button { .#{$choices-selector}__button {
@ -80,19 +86,22 @@ $choices-z-index: 1;
width: 20px; width: 20px;
border-radius: 10em; border-radius: 10em;
opacity: 0.25; opacity: 0.25;
&:hover, &:hover,
&:focus { &:focus {
opacity: 1; opacity: 1;
} }
&:focus { &:focus {
box-shadow: 0px 0px 0px 2px $choices-highlight-color; box-shadow: 0 0 0 2px $choices-highlight-color;
} }
} }
.#{$choices-selector}__item[data-value=''] .#{$choices-selector}__button { .#{$choices-selector}__item[data-value=''] .#{$choices-selector}__button {
display: none; display: none;
} }
&:after {
content: ''; &::after {
content: "";
height: 0; height: 0;
width: 0; width: 0;
border-style: solid; border-style: solid;
@ -104,12 +113,14 @@ $choices-z-index: 1;
margin-top: -2.5px; margin-top: -2.5px;
pointer-events: none; pointer-events: none;
} }
&.is-open:after {
&.is-open::after {
border-color: transparent transparent $choices-text-color transparent; border-color: transparent transparent $choices-text-color transparent;
margin-top: -7.5px; margin-top: -7.5px;
} }
&[dir='rtl'] {
&:after { &[dir="rtl"] {
&::after {
left: 11.5px; left: 11.5px;
right: auto; right: auto;
} }
@ -135,13 +146,14 @@ $choices-z-index: 1;
margin-bottom: 0; margin-bottom: 0;
margin-left: $choices-button-offset; margin-left: $choices-button-offset;
padding-left: $choices-button-offset * 2; padding-left: $choices-button-offset * 2;
border-left: 1px solid darken($choices-primary-color, 10%); border-left: 1px solid color.adjust($choices-primary-color, $lightness: -10%);
background-image: $choices-icon-cross; background-image: $choices-icon-cross;
background-size: $choices-button-dimension; background-size: $choices-button-dimension;
width: $choices-button-dimension; width: $choices-button-dimension;
line-height: 1; line-height: 1;
opacity: 0.75; opacity: 0.75;
border-radius: 0; border-radius: 0;
&:hover, &:hover,
&:focus { &:focus {
opacity: 1; opacity: 1;
@ -160,13 +172,16 @@ $choices-z-index: 1;
font-size: $choices-font-size-md; font-size: $choices-font-size-md;
min-height: 44px; min-height: 44px;
overflow: hidden; overflow: hidden;
.is-focused &, .is-focused &,
.is-open & { .is-open & {
border-color: darken($choices-keyline-color, 15%); border-color: color.adjust($choices-keyline-color, $lightness: -15%);
} }
.is-open & { .is-open & {
border-radius: $choices-border-radius $choices-border-radius 0 0; border-radius: $choices-border-radius $choices-border-radius 0 0;
} }
.is-flipped.is-open & { .is-flipped.is-open & {
border-radius: 0 0 $choices-border-radius $choices-border-radius; border-radius: 0 0 $choices-border-radius $choices-border-radius;
} }
@ -182,7 +197,8 @@ $choices-z-index: 1;
display: inline-block; display: inline-block;
padding: 4px 16px 4px 4px; padding: 4px 16px 4px 4px;
width: 100%; width: 100%;
[dir='rtl'] & {
[dir="rtl"] & {
padding-right: 4px; padding-right: 4px;
padding-left: 16px; padding-left: 16px;
} }
@ -203,24 +219,28 @@ $choices-z-index: 1;
margin-right: 3.75px; margin-right: 3.75px;
margin-bottom: 3.75px; margin-bottom: 3.75px;
background-color: $choices-primary-color; background-color: $choices-primary-color;
border: 1px solid darken($choices-primary-color, 5%); border: 1px solid color.adjust($choices-primary-color, $lightness: -5%);
color: #ffffff; color: #fff;
word-break: break-all; word-break: break-all;
box-sizing: border-box; box-sizing: border-box;
&[data-deletable] { &[data-deletable] {
padding-right: 5px; padding-right: 5px;
} }
[dir='rtl'] & {
[dir="rtl"] & {
margin-right: 0; margin-right: 0;
margin-left: 3.75px; margin-left: 3.75px;
} }
&.is-highlighted { &.is-highlighted {
background-color: darken($choices-primary-color, 5%); background-color: color.adjust($choices-primary-color, $lightness: -5%);
border: 1px solid darken($choices-primary-color, 10%); border: 1px solid color.adjust($choices-primary-color, $lightness: -10%);
} }
.is-disabled & { .is-disabled & {
background-color: darken($choices-disabled-color, 25%); background-color: color.adjust($choices-disabled-color, $lightness: -25%);
border: 1px solid darken($choices-disabled-color, 35%); border: 1px solid color.adjust($choices-disabled-color, $lightness: -35%);
} }
} }
} }
@ -239,12 +259,15 @@ $choices-z-index: 1;
overflow: hidden; overflow: hidden;
word-break: break-all; word-break: break-all;
will-change: visibility; will-change: visibility;
&.is-active { &.is-active {
visibility: visible; visibility: visible;
} }
.is-open & { .is-open & {
border-color: darken($choices-keyline-color, 15%); border-color: color.adjust($choices-keyline-color, $lightness: -15%);
} }
.is-flipped & { .is-flipped & {
top: auto; top: auto;
bottom: 100%; bottom: 100%;
@ -263,14 +286,16 @@ $choices-z-index: 1;
position: relative; position: relative;
padding: 10px; padding: 10px;
font-size: $choices-font-size-md; font-size: $choices-font-size-md;
[dir='rtl'] & {
[dir="rtl"] & {
text-align: right; text-align: right;
} }
} }
.#{$choices-selector}__item--selectable { .#{$choices-selector}__item--selectable {
@media (min-width: 640px) { @media (min-width: 640px) {
padding-right: 100px; padding-right: 100px;
&:after {
&::after {
content: attr(data-select-text); content: attr(data-select-text);
font-size: $choices-font-size-sm; font-size: $choices-font-size-sm;
opacity: 0; opacity: 0;
@ -279,19 +304,23 @@ $choices-z-index: 1;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
[dir='rtl'] & {
[dir="rtl"] & {
text-align: right; text-align: right;
padding-left: 100px; padding-left: 100px;
padding-right: 10px; padding-right: 10px;
&:after {
&::after {
right: auto; right: auto;
left: 10px; left: 10px;
} }
} }
} }
&.is-highlighted { &.is-highlighted {
background-color: mix(#000000, #ffffff, 5%); background-color: color.mix(#000, #fff, 5%);
&:after {
&::after {
opacity: 0.5; opacity: 0.5;
} }
} }
@ -316,19 +345,19 @@ $choices-z-index: 1;
font-weight: 600; font-weight: 600;
font-size: $choices-font-size-sm; font-size: $choices-font-size-sm;
padding: 10px; padding: 10px;
border-bottom: 1px solid lighten($choices-keyline-color, 10%); border-bottom: 1px solid color.adjust($choices-keyline-color, $lightness: 10%);
color: lighten(#333, 30%); color: color.adjust(#333, $lightness: 30%);
} }
.#{$choices-selector}__button { .#{$choices-selector}__button {
text-indent: -9999px; text-indent: -9999px;
-webkit-appearance: none;
appearance: none; appearance: none;
border: 0; border: 0;
background-color: transparent; background-color: transparent;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
cursor: pointer; cursor: pointer;
&:focus { &:focus {
outline: none; outline: none;
} }
@ -344,10 +373,12 @@ $choices-z-index: 1;
border-radius: 0; border-radius: 0;
max-width: 100%; max-width: 100%;
padding: 4px 0 4px 2px; padding: 4px 0 4px 2px;
&:focus { &:focus {
outline: 0; outline: 0;
} }
[dir='rtl'] & {
[dir="rtl"] & {
padding-right: 2px; padding-right: 2px;
padding-left: 0; padding-left: 0;
} }
@ -357,4 +388,4 @@ $choices-z-index: 1;
opacity: 0.5; opacity: 0.5;
} }
/*===== End of Choices ======*/ /* ===== End of Choices ====== */