We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32dd1bc commit 6650606Copy full SHA for 6650606
src/demo/js/script.js
@@ -10,7 +10,17 @@ let preview = {
10
const params = Array.from(document.querySelectorAll(".param")).reduce(
11
(acc, next) => {
12
let obj = { ...acc };
13
- obj[next.id] = next.value.replace(/#/g, "").replace(/(F|f){2}$/, "");
+ let value = next.value;
14
+
15
+ if (value.indexOf('#') >= 0) {
16
+ // if the value is colour, remove the hash sign
17
+ value = value.replace(/#/g, "");
18
+ if (value.length > 6) {
19
+ // if the value is in hexa and opacity is 1, remove FF
20
+ value = value.replace(/(F|f){2}$/, "");
21
+ }
22
23
+ obj[next.id] = value;
24
return obj;
25
},
26
{}
0 commit comments