Browse Source

Implement stylelint

pull/979/head
Matt Triff 1 month ago
parent
commit
9835eb756a
  1. 3
      .github/workflows/lint.yml
  2. 6
      .stylelintrc.json
  3. 8
      .vscode/settings.json
  4. 16551
      package-lock.json
  5. 7
      package.json
  6. 25
      public/assets/styles/base.css
  7. 2
      public/assets/styles/base.css.map
  8. 2
      public/assets/styles/base.min.css
  9. 42
      public/assets/styles/choices.css
  10. 2
      public/assets/styles/choices.css.map
  11. 2
      public/assets/styles/choices.min.css
  12. 2
      public/index.html
  13. 28
      src/styles/base.scss
  14. 105
      src/styles/choices.scss

3
.github/workflows/lint.yml

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

6
.stylelintrc.json

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

8
.vscode/settings.json

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

16551
package-lock.json

File diff suppressed because it is too large

7
package.json

@ -7,7 +7,9 @@
"scripts": {
"start": "run-p js:watch css:watch",
"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",
"cypress:run": "cypress run --browser chrome",
"cypress:open": "cypress open",
@ -93,6 +95,9 @@
"sass": "^1.45.0",
"sinon": "^12.0.1",
"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-node": "^10.4.0",
"typescript": "^4.5.4",

25
public/assets/styles/base.css

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

2
public/assets/styles/base.css.map

@ -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"}

2
public/assets/styles/base.min.css

@ -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}

42
public/assets/styles/choices.css

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

2
public/assets/styles/choices.css.map

@ -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"}

2
public/assets/styles/choices.min.css

File diff suppressed because one or more lines are too long

2
public/index.html

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

28
src/styles/base.scss

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

105
src/styles/choices.scss

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

Loading…
Cancel
Save