@thednp/color-picker 1.0.1 → 2.0.0-alpha10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. package/.eslintrc.cjs +199 -0
  2. package/.lgtm.yml +9 -0
  3. package/.prettierrc.json +15 -0
  4. package/.stylelintrc.json +236 -0
  5. package/README.md +55 -72
  6. package/compile.js +51 -0
  7. package/cypress/e2e/color-palette.cy.ts +128 -0
  8. package/cypress/e2e/color-picker.cy.ts +909 -0
  9. package/cypress/fixtures/colorNamesFrench.js +3 -0
  10. package/cypress/fixtures/componentLabelsFrench.js +21 -0
  11. package/cypress/fixtures/format.js +3 -0
  12. package/cypress/fixtures/getMarkup.js +35 -0
  13. package/cypress/fixtures/getRandomInt.js +6 -0
  14. package/cypress/fixtures/sampleWebcolors.js +18 -0
  15. package/cypress/fixtures/testSample.js +8 -0
  16. package/cypress/plugins/esbuild-istanbul.ts +50 -0
  17. package/cypress/plugins/tsCompile.ts +34 -0
  18. package/cypress/support/commands.ts +0 -0
  19. package/cypress/support/e2e.ts +21 -0
  20. package/cypress/test.html +23 -0
  21. package/cypress.config.ts +29 -0
  22. package/dist/css/color-picker.css +25 -54
  23. package/dist/css/color-picker.min.css +2 -2
  24. package/dist/css/color-picker.rtl.css +25 -54
  25. package/dist/css/color-picker.rtl.min.css +2 -2
  26. package/dist/js/color-picker.cjs +8 -0
  27. package/dist/js/color-picker.cjs.map +1 -0
  28. package/dist/js/color-picker.d.ts +296 -0
  29. package/dist/js/color-picker.js +5 -3570
  30. package/dist/js/color-picker.js.map +1 -0
  31. package/dist/js/color-picker.mjs +2618 -0
  32. package/dist/js/color-picker.mjs.map +1 -0
  33. package/dts.config.ts +15 -0
  34. package/package.json +116 -108
  35. package/src/scss/_variables.scss +0 -1
  36. package/src/scss/color-picker.rtl.scss +4 -0
  37. package/src/scss/color-picker.scss +93 -51
  38. package/src/ts/colorPalette.ts +89 -0
  39. package/src/{js/color-picker.js → ts/index.ts} +498 -509
  40. package/src/ts/interface/ColorNames.ts +20 -0
  41. package/src/ts/interface/colorPickerLabels.ts +20 -0
  42. package/src/ts/interface/colorPickerOptions.ts +11 -0
  43. package/src/ts/interface/paletteOptions.ts +6 -0
  44. package/src/ts/util/colorNames.ts +21 -0
  45. package/src/{js/util/colorPickerLabels.js → ts/util/colorPickerLabels.ts} +4 -2
  46. package/src/ts/util/getColorControls.ts +90 -0
  47. package/src/{js/util/getColorForm.js → ts/util/getColorForm.ts} +28 -18
  48. package/src/{js/util/getColorMenu.js → ts/util/getColorMenu.ts} +21 -30
  49. package/src/ts/util/isValidJSON.ts +19 -0
  50. package/src/{js/util/setMarkup.js → ts/util/setMarkup.ts} +61 -50
  51. package/tsconfig.json +29 -0
  52. package/vite.config.ts +34 -0
  53. package/dist/js/color-esm.js +0 -1164
  54. package/dist/js/color-esm.min.js +0 -2
  55. package/dist/js/color-palette-esm.js +0 -1235
  56. package/dist/js/color-palette-esm.min.js +0 -2
  57. package/dist/js/color-palette.js +0 -1243
  58. package/dist/js/color-palette.min.js +0 -2
  59. package/dist/js/color-picker-element-esm.js +0 -3718
  60. package/dist/js/color-picker-element-esm.min.js +0 -2
  61. package/dist/js/color-picker-element.js +0 -3726
  62. package/dist/js/color-picker-element.min.js +0 -2
  63. package/dist/js/color-picker-esm.js +0 -3565
  64. package/dist/js/color-picker-esm.min.js +0 -2
  65. package/dist/js/color-picker.min.js +0 -2
  66. package/dist/js/color.js +0 -1172
  67. package/dist/js/color.min.js +0 -2
  68. package/src/js/color-palette.js +0 -75
  69. package/src/js/color-picker-element.js +0 -107
  70. package/src/js/color.js +0 -1104
  71. package/src/js/index.js +0 -8
  72. package/src/js/util/colorNames.js +0 -6
  73. package/src/js/util/getColorControls.js +0 -103
  74. package/src/js/util/isValidJSON.js +0 -13
  75. package/src/js/util/nonColors.js +0 -5
  76. package/src/js/util/roundPart.js +0 -9
  77. package/src/js/util/setCSSProperties.js +0 -12
  78. package/src/js/util/tabindex.js +0 -3
  79. package/src/js/util/toggleCEAttr.js +0 -70
  80. package/src/js/util/version.js +0 -5
  81. package/src/js/version.js +0 -5
  82. package/types/cp.d.ts +0 -558
  83. package/types/index.d.ts +0 -44
  84. package/types/source/source.ts +0 -4
  85. package/types/source/types.d.ts +0 -92
  86. /package/src/{js/util/vHidden.js → ts/util/vHidden.ts} +0 -0
package/package.json CHANGED
@@ -1,108 +1,116 @@
1
- {
2
- "name": "@thednp/color-picker",
3
- "version": "1.0.1",
4
- "description": "Modern Color Picker Web Component",
5
- "main": "dist/js/color-picker.min.js",
6
- "module": "dist/js/color-picker.esm.js",
7
- "types": "types/index.d.ts",
8
- "style": "dist/css/color-picker.min.css",
9
- "sass": "src/scss/color-picker.scss",
10
- "jsnext": "src/js/color-picker.js",
11
- "files": [
12
- "types",
13
- "dist",
14
- "src"
15
- ],
16
- "publishConfig": {
17
- "access": "public",
18
- "registry": "https://registry.npmjs.org/"
19
- },
20
- "scripts": {
21
- "test": "cypress run",
22
- "cypress": "npx cypress open",
23
- "coverage:report": "nyc report --reporter=lcov --reporter=json --reporter=text --reporter=json-summary",
24
- "fix:js": "eslint src/ --config .eslintrc --fix",
25
- "lint:js": "eslint src/ --config .eslintrc",
26
- "fix:css": "stylelint --config .stylelintrc.json -s --fix scss \"src/scss/*.scss\"",
27
- "lint:css": "stylelint --config .stylelintrc.json -s scss \"src/scss/*.scss\"",
28
- "bundle": "npm-run-all build compile",
29
- "build": "npm run lint:js && npm-run-all --parallel build-* && npm-run-all --parallel copy-js-*",
30
- "build:ts": "tsc -d",
31
- "build-js": "rollup --environment FORMAT:umd,MIN:false -c",
32
- "build-ce": "rollup --environment FORMAT:umd,MIN:false,NAME:ColorPickerElement,INPUTFILE:src/js/color-picker-element.js,OUTPUTFILE:dist/js/color-picker-element.js -c",
33
- "build-ce-min": "rollup --environment FORMAT:umd,MIN:true,NAME:ColorPickerElement,INPUTFILE:src/js/color-picker-element.js,OUTPUTFILE:dist/js/color-picker-element.min.js -c",
34
- "build-ce-esm": "rollup --environment FORMAT:esm,MIN:false,NAME:ColorPickerElement,INPUTFILE:src/js/color-picker-element.js,OUTPUTFILE:dist/js/color-picker-element-esm.js -c",
35
- "build-ce-esm-min": "rollup --environment FORMAT:esm,MIN:true,NAME:ColorPickerElement,INPUTFILE:src/js/color-picker-element.js,OUTPUTFILE:dist/js/color-picker-element-esm.min.js -c",
36
- "build-cl": "rollup --environment FORMAT:umd,MIN:false,NAME:Color,INPUTFILE:src/js/color.js,OUTPUTFILE:dist/js/color.js -c",
37
- "build-cl-min": "rollup --environment FORMAT:umd,MIN:true,NAME:Color,INPUTFILE:src/js/color.js,OUTPUTFILE:dist/js/color.min.js -c",
38
- "build-cl-esm": "rollup --environment FORMAT:esm,MIN:false,NAME:Color,INPUTFILE:src/js/color.js,OUTPUTFILE:dist/js/color-esm.js -c",
39
- "build-cl-esm-min": "rollup --environment FORMAT:esm,MIN:true,NAME:Color,INPUTFILE:src/js/color.js,OUTPUTFILE:dist/js/color-esm.min.js -c",
40
- "build-cpl": "rollup --environment FORMAT:umd,MIN:false,NAME:ColorPalette,INPUTFILE:src/js/color-palette.js,OUTPUTFILE:dist/js/color-palette.js -c",
41
- "build-cpl-min": "rollup --environment FORMAT:umd,MIN:true,NAME:ColorPalette,INPUTFILE:src/js/color-palette.js,OUTPUTFILE:dist/js/color-palette.min.js -c",
42
- "build-cpl-esm": "rollup --environment FORMAT:esm,MIN:false,NAME:ColorPalette,INPUTFILE:src/js/color-palette.js,OUTPUTFILE:dist/js/color-palette-esm.js -c",
43
- "build-cpl-esm-min": "rollup --environment FORMAT:esm,MIN:true,NAME:ColorPalette,INPUTFILE:src/js/color-palette.js,OUTPUTFILE:dist/js/color-palette-esm.min.js -c",
44
- "build-minjs": "rollup --environment FORMAT:umd,MIN:true -c",
45
- "build-esm": "rollup --environment FORMAT:esm,MIN:false -c",
46
- "build-esmjs": "rollup --environment FORMAT:esm,MIN:true -c",
47
- "copy": "npm-run-all --parallel copy-*",
48
- "copy-js-cp": "ncp dist/js/color-picker.js docs/js/color-picker.js",
49
- "copy-js-ce": "ncp dist/js/color-picker-element.js docs/js/color-picker-element.js",
50
- "copy-css-cp": "ncp dist/css/color-picker.css docs/css/color-picker.css",
51
- "copy-css-rtl": "ncp dist/css/color-picker.rtl.css docs/css/color-picker.rtl.css",
52
- "compile": "npm run lint:css && npm-run-all --parallel compile-* && npm-run-all --parallel copy-css-*",
53
- "compile-scss": "node compile.js",
54
- "compile-scss-min": "node compile.js MIN:true",
55
- "compile-scss-rtl": "node compile.js MIN:false,DIR:rtl",
56
- "compile-scss-rtl-min": "node compile.js MIN:true,DIR:rtl"
57
- },
58
- "repository": {
59
- "type": "git",
60
- "url": "git+https://github.com/thednp/color-picker.git"
61
- },
62
- "keywords": [
63
- "color",
64
- "picker",
65
- "color-picker",
66
- "colorpicker",
67
- "palette",
68
- "color-palette",
69
- "javascript"
70
- ],
71
- "author": "thednp",
72
- "license": "MIT",
73
- "bugs": {
74
- "url": "https://github.com/thednp/color-picker/issues"
75
- },
76
- "homepage": "http://thednp.github.io/color-picker",
77
- "dependencies": {
78
- "@thednp/event-listener": "^1.0.4",
79
- "shorter-js": "^0.3.4"
80
- },
81
- "devDependencies": {
82
- "@bahmutov/cypress-esbuild-preprocessor": "^2.1.3",
83
- "@cypress/code-coverage": "^3.9.12",
84
- "@rollup/plugin-buble": "^0.21.3",
85
- "@rollup/plugin-commonjs": "^21.0.3",
86
- "@rollup/plugin-json": "^4.1.0",
87
- "@rollup/plugin-node-resolve": "^7.1.3",
88
- "cypress": "^9.7.0",
89
- "esbuild": "^0.14.30",
90
- "eslint": "^7.22.0",
91
- "eslint-config-airbnb-base": "^14.2.1",
92
- "eslint-plugin-import": "^2.22.1",
93
- "eslint-plugin-vue": "^7.7.0",
94
- "istanbul-lib-coverage": "^3.2.0",
95
- "istanbul-lib-instrument": "^5.2.0",
96
- "ncp": "^2.0.0",
97
- "npm-run-all": "^4.1.5",
98
- "nyc": "^15.1.0",
99
- "rollup": "^2.71.1",
100
- "rollup-plugin-terser": "^5.3.1",
101
- "sass": "^1.39.0",
102
- "stylelint": "^13.12.0",
103
- "stylelint-config-standard": "^20.0.0",
104
- "stylelint-order": "^4.1.0",
105
- "stylelint-scss": "^3.19.0",
106
- "typescript": "^4.5.2"
107
- }
108
- }
1
+ {
2
+ "name": "@thednp/color-picker",
3
+ "version": "2.0.0-alpha10",
4
+ "author": "thednp",
5
+ "license": "MIT",
6
+ "description": "🎨 Modern Color Picker Component",
7
+ "homepage": "http://thednp.github.io/color-picker",
8
+ "source": "./src/ts/index.ts",
9
+ "main": "./dist/js/color-picker.js",
10
+ "module": "./dist/js/color-picker.mjs",
11
+ "style": "./dist/css/color-picker.css",
12
+ "sass": "./src/scss/color-picker.scss",
13
+ "exports": {
14
+ ".": {
15
+ "require": "./dist/js/color-picker.cjs",
16
+ "import": "./dist/js/color-picker.mjs",
17
+ "types": "./dist/js/color-picker.d.ts"
18
+ },
19
+ "./dist/css/color-picker.css": {
20
+ "import": "./dist/css/color-picker.css",
21
+ "require": "./dist/css/color-picker.css"
22
+ },
23
+ "./dist/css/color-picker.rtl.css": {
24
+ "import": "./dist/css/color-picker.rtl.css",
25
+ "require": "./dist/css/color-picker.rtl.css"
26
+ },
27
+ "./src/scss/color-picker.scss": {
28
+ "import": "./src/scss/color-picker.scss",
29
+ "require": "./src/scss/color-picker.scss"
30
+ },
31
+ "./src/scss/color-picker.rtl.scss": {
32
+ "import": "./src/scss/color-picker.rtl.scss",
33
+ "require": "./src/scss/color-picker.rtl.scss"
34
+ }
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/thednp/color-picker/issues"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public",
41
+ "registry": "https://registry.npmjs.org/"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/thednp/color-picker.git"
46
+ },
47
+ "keywords": [
48
+ "color",
49
+ "picker",
50
+ "color-picker",
51
+ "colorpicker",
52
+ "palette",
53
+ "color-palette",
54
+ "typescript"
55
+ ],
56
+ "dependencies": {
57
+ "@thednp/color": "^1.0.8",
58
+ "@thednp/shorty": "2.0.0-alpha22"
59
+ },
60
+ "devDependencies": {
61
+ "@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
62
+ "@cypress/code-coverage": "^3.12.0",
63
+ "@types/istanbul-lib-instrument": "^1.7.4",
64
+ "@typescript-eslint/eslint-plugin": "^6.6.0",
65
+ "@typescript-eslint/parser": "^6.6.0",
66
+ "cypress": "^13.1.0",
67
+ "dts-bundle-generator": "^8.0.1",
68
+ "eslint": "^8.49.0",
69
+ "eslint-plugin-jsdoc": "^46.5.1",
70
+ "eslint-plugin-prefer-arrow": "^1.2.3",
71
+ "eslint-plugin-prettier": "^5.0.0",
72
+ "istanbul-lib-coverage": "^3.2.0",
73
+ "istanbul-lib-instrument": "^6.0.0",
74
+ "ncp": "^2.0.0",
75
+ "npm-run-all": "^4.1.5",
76
+ "nyc": "^15.1.0",
77
+ "prettier": "^3.0.3",
78
+ "rimraf": "^5.0.1",
79
+ "sass": "^1.66.1",
80
+ "stylelint": "^15.10.3",
81
+ "stylelint-config-standard": "^34.0.0",
82
+ "stylelint-config-standard-scss": "^11.0.0",
83
+ "stylelint-order": "^6.0.3",
84
+ "stylelint-scss": "^5.1.0",
85
+ "typescript": "^5.2.2",
86
+ "vite": "^4.4.9"
87
+ },
88
+ "packageManager": "pnpm@8.6.12",
89
+ "scripts": {
90
+ "pre-test": "npm run clean-coverage",
91
+ "test": "npm run pre-test && cypress run",
92
+ "cypress": "npm run pre-test && npx cypress open",
93
+ "clean-coverage": "rimraf coverage .nyc_output",
94
+ "coverage:report": "nyc report --reporter=lcov --reporter=json --reporter=text --reporter=json-summary",
95
+ "format": "prettier --write \"src/**/*.ts\"",
96
+ "lint": "npm run lint:ts && npm run check:ts && npm run lint:css",
97
+ "fix:ts": "eslint src --config .eslintrc.cjs --fix",
98
+ "lint:ts": "eslint src --config .eslintrc.cjs",
99
+ "check:ts": "tsc --noEmit",
100
+ "fix:css": "stylelint --config .stylelintrc.json --fix scss \"src/scss/*.scss\"",
101
+ "lint:css": "stylelint --config .stylelintrc.json scss \"src/scss/*.scss\"",
102
+ "build": "npm run lint && npm run build-vite && npm run dts",
103
+ "build-vite": "vite build && npm run docs",
104
+ "dev": "vite --open ./docs/dev.html --port 8577",
105
+ "dts": "dts-bundle-generator --config ./dts.config.ts",
106
+ "docs": "ncp dist/js/color-picker.js docs/js/color-picker.js && ncp dist/js/color-picker.js.map docs/js/color-picker.js.map",
107
+ "copy": "npm-run-all --parallel copy-*",
108
+ "copy-css-cp": "ncp dist/css/color-picker.css docs/css/color-picker.css",
109
+ "copy-css-rtl": "ncp dist/css/color-picker.rtl.css docs/css/color-picker.rtl.css",
110
+ "compile": "npm run lint:css && npm-run-all --parallel compile-* && npm run copy",
111
+ "compile-scss": "node compile.js",
112
+ "compile-scss-min": "node compile.js MIN:true",
113
+ "compile-scss-rtl": "node compile.js MIN:false,DIR:rtl",
114
+ "compile-scss-rtl-min": "node compile.js MIN:true,DIR:rtl"
115
+ }
116
+ }
@@ -1,7 +1,6 @@
1
1
  $transparency-levels: (
2
2
  15, 25, 33, 50, 75, 90
3
3
  );
4
-
5
4
  $dropdown-transition: transform .33s ease, opacity .33s ease;
6
5
  $btn-transition: box-shadow .33s ease, border .33s ease;
7
6
  $options-transition: height .33s ease;
@@ -7,16 +7,20 @@
7
7
  right: auto; left: 0;
8
8
  border-radius: .25rem 0 0 .25rem;
9
9
  }
10
+
10
11
  .color-dropdown.picker {
11
12
  right: 0; left: auto;
12
13
  }
14
+
13
15
  .color-dropdown.menu {
14
16
  right: auto; left: 0;
15
17
  }
18
+
16
19
  .color-control + .color-control {
17
20
  margin-right: .5rem;
18
21
  margin-left: 0;
19
22
  }
23
+
20
24
  .color-options.scrollable {
21
25
  margin: 0 0 0 -.5rem;
22
26
  }
@@ -1,23 +1,30 @@
1
1
  @import "variables";
2
2
 
3
3
  /* :host */
4
- color-picker,
5
4
  .color-picker {
6
5
  position: relative;
7
6
  display: flex;
8
7
 
8
+ *, *::before, *::after {
9
+ box-sizing: border-box;
10
+ }
11
+
9
12
  @each $name in "white", "black" {
10
13
  @each $lvl in $transparency-levels {
11
- @if (type-of($name) == "string" and type-of($lvl) == "number") {
14
+ @if type-of($name) == "string" and type-of($lvl) == "number" {
12
15
  $color: #fff;
16
+
13
17
  @if $name == "black" {
14
18
  $color: #000;
15
19
  }
16
- $rgba: rgba($color, $lvl * .01);
20
+
21
+ $rgba: rgba($color, $lvl * 1%);
22
+
17
23
  --#{$name}-#{$lvl}: #{$rgba};
18
24
  }
19
25
  }
20
26
  }
27
+
21
28
  --dropdown-transition: #{$dropdown-transition};
22
29
  --btn-transition: #{$btn-transition};
23
30
  --options-transition: #{$options-transition};
@@ -40,7 +47,6 @@ color-picker,
40
47
  --visual-shadow: 0 0 0 1px var(--white-15) inset;
41
48
  }
42
49
 
43
- color-picker:focus,
44
50
  .color-picker:focus {
45
51
  outline: none;
46
52
  }
@@ -62,7 +68,11 @@ color-picker:focus,
62
68
  }
63
69
 
64
70
  .color-dropdown.picker { left: 0; }
65
- .color-dropdown.menu { right: 0; }
71
+
72
+ .color-dropdown.menu {
73
+ right: 0;
74
+ max-height: 230px;
75
+ }
66
76
 
67
77
  .open .color-dropdown.top {
68
78
  top: auto;
@@ -92,7 +102,8 @@ color-picker:focus,
92
102
  /* btn-appearance */
93
103
  .btn-appearance {
94
104
  width: 100%;
95
- height: 1.5rem;
105
+
106
+ // height: 1.5rem;
96
107
  padding: .6rem 1rem;
97
108
  font-size: 1rem;
98
109
  line-height: 1.5;
@@ -100,10 +111,12 @@ color-picker:focus,
100
111
  border-radius: .25rem;
101
112
  outline: none;
102
113
  appearance: none;
114
+
103
115
  // transition-duration: .33s;
104
116
  // transition-property: box-shadow, border;
105
117
  transition: var(--btn-transition);
106
118
  }
119
+
107
120
  .btn-appearance:focus,
108
121
  .btn-appearance:hover {
109
122
  box-shadow: 0 0 0 3px var(--black-15);
@@ -111,26 +124,31 @@ color-picker:focus,
111
124
 
112
125
  /* color-preview */
113
126
  .color-preview {
114
- box-shadow: 0 0 0 1px rgba(120,120,120,.33) inset;
127
+ box-shadow: 0 0 0 1px rgba(120,120,120,33%) inset;
115
128
  direction: ltr; /* color value can never be rtl */
116
129
  }
117
130
 
118
131
  .txt-dark .color-preview {
119
132
  color: var(--white-75);
120
133
  }
134
+
121
135
  .txt-dark .color-preview:focus {
122
136
  box-shadow: 0 0 0 1px #fff inset, 0 0 0 3px var(--black-15);
123
137
  }
138
+
124
139
  .txt-dark .color-preview::placeholder {
125
140
  color: var(--white-50);
126
141
  }
142
+
127
143
  .txt-light .color-preview {
128
144
  color: var(--black-75);
129
145
  }
146
+
130
147
  .txt-light .color-preview:focus {
131
148
  color: var(--black-75);
132
149
  box-shadow: 0 0 0 1px #000 inset, 0 0 0 3px var(--black-15);
133
150
  }
151
+
134
152
  .txt-light .color-preview::placeholder {
135
153
  color: var(--black-50);
136
154
  }
@@ -138,10 +156,10 @@ color-picker:focus,
138
156
  /* picker-toggle */
139
157
  .picker-toggle {
140
158
  position: absolute;
141
- top: 0;
142
- left: 0;
159
+ inset: 0;
143
160
  width: 100%;
144
161
  height: 100%;
162
+ cursor: pointer;
145
163
  background: transparent;
146
164
  border: 0;
147
165
  }
@@ -163,20 +181,23 @@ color-picker:focus,
163
181
  border: 0;
164
182
  border-radius: 0 .25rem .25rem 0;
165
183
  }
184
+
166
185
  .txt-light .menu-toggle {
167
186
  background: var(--black-50);
187
+
188
+ &:focus {
189
+ background: var(--black-75);
190
+ }
168
191
  }
169
- .txt-light .menu-toggle:focus,
170
- .txt-light .menu-toggle:focus {
171
- background: var(--black-75);
172
- }
192
+
173
193
  .txt-dark .menu-toggle {
174
194
  background: var(--white-33);
195
+
196
+ &:focus {
197
+ background: var(--white-50);
198
+ }
175
199
  }
176
- .txt-dark .menu-toggle:focus,
177
- .txt-dark .menu-toggle:focus {
178
- background: var(--white-50);
179
- }
200
+
180
201
  .menu-toggle svg {
181
202
  width: auto;
182
203
  height: 100%;
@@ -188,6 +209,7 @@ color-picker:focus,
188
209
  overflow-y: auto;
189
210
  scrollbar-width: thin;
190
211
  }
212
+
191
213
  .scrollable::-webkit-scrollbar {
192
214
  width: .5rem;
193
215
  }
@@ -214,8 +236,9 @@ color-picker:focus,
214
236
  /* color-defaults */
215
237
  .color-defaults {
216
238
  display: none;
217
- flex-wrap: wrap;
218
- flex-flow: column;
239
+
240
+ // flex-wrap: ;
241
+ flex-flow: column wrap;
219
242
  margin: 0;
220
243
  list-style: none;
221
244
  padding-inline: 0; // Firefox
@@ -226,9 +249,9 @@ color-picker:focus,
226
249
  display: flex;
227
250
  }
228
251
 
229
- .color-dropdown.menu {
230
- max-height: 230px;
231
- }
252
+ // .color-dropdown.menu {
253
+ // max-height: 230px;
254
+ // }
232
255
 
233
256
  .color-defaults .color-option {
234
257
  padding: .25rem .5rem;
@@ -259,6 +282,7 @@ color-picker:focus,
259
282
  --grid-gap: .25rem; // grid vertical / horizontal spacing
260
283
  --grid-height: auto; // default height
261
284
  --grid-hover-height: auto; // height on hover
285
+
262
286
  display: grid;
263
287
  padding: 0;
264
288
  margin: 0;
@@ -267,44 +291,55 @@ color-picker:focus,
267
291
  grid-template-rows: repeat(auto-fill, var(--grid-item-size));
268
292
  gap: var(--grid-gap);
269
293
  }
294
+
270
295
  .color-options.scrollable {
271
296
  height: var(--grid-height);
272
297
  margin: 0 -.5rem 0 0; // 0.5rem is the scrollbar width
273
298
  overflow-y: scroll;
274
299
  transition: var(--options-transition);
275
300
  }
276
- .color-options.scrollable:hover {
301
+
302
+ // .color-options.scrollable:hover {
303
+ .color-dropdown.menu:hover .scrollable {
277
304
  height: var(--grid-hover-height);
278
305
  }
306
+
279
307
  .color-options + .color-defaults {
280
308
  margin-top: .25rem;
281
309
  }
310
+
282
311
  .multiline + .color-defaults {
283
- flex-direction: row;
284
- flex-wrap: wrap;
312
+ flex-flow: row wrap;
313
+
285
314
  .color-option {
286
315
  padding: .25rem .33rem; font-size: 12px;
287
316
  }
288
317
  }
318
+
289
319
  .color-options .color-option {
290
320
  // hide any text
291
321
  position: relative;
292
322
  width: var(--grid-item-size);
293
323
  height: var(--grid-item-size);
294
324
  overflow: hidden;
295
- text-indent: 2.1rem;
296
- }
297
- .color-options .color-option:active,
298
- .color-options .color-option:focus {
299
- outline: none;
325
+ color: rgba(0,0,0,0%);
326
+
327
+ &:active, &:focus {
328
+ outline: none;
329
+ box-shadow: 0 0 0 4px rgba(125,125,125,75%) inset;
330
+ }
300
331
  }
332
+
333
+ // .color-options .color-option:active,
334
+ // .color-options .color-option:focus {
335
+ // outline: none;
336
+ // }
337
+
301
338
  .color-options .color-option::before {
302
339
  position: absolute;
303
- top: 0;
304
- right: 0;
305
- bottom: 0;
306
- left: 0;
340
+ inset: 0;
307
341
  }
342
+
308
343
  .color-options .color-option:hover::before,
309
344
  .color-options .color-option:active::before,
310
345
  .color-options .color-option:focus::before {
@@ -313,13 +348,15 @@ color-picker:focus,
313
348
  mix-blend-mode: difference;
314
349
  }
315
350
 
316
- .color-options .color-option:active,
317
- .color-options .color-option:focus {
318
- box-shadow: 0 0 0 4px rgba(125,125,125,.75) inset;
319
- }
351
+ // .color-options .color-option {
352
+ // &:active, &:focus {
353
+ // outline: none;
354
+ // box-shadow: 0 0 0 4px rgba(125,125,125,75%) inset;
355
+ // }
356
+ // }
320
357
 
321
358
  .color-options .color-option.active {
322
- &:after {
359
+ &::after {
323
360
  position: absolute;
324
361
  top: 50%;
325
362
  left: 50%;
@@ -330,18 +367,19 @@ color-picker:focus,
330
367
  border-radius: 4px;
331
368
  }
332
369
  }
333
- .txt-dark .color-options .color-option.active:after {
370
+
371
+ .txt-dark .color-options .color-option.active::after {
334
372
  box-shadow: 0 0 0 4px var(--white-90);
335
373
  }
336
- .txt-light .color-options .color-option.active:after {
374
+
375
+ .txt-light .color-options .color-option.active::after {
337
376
  box-shadow: 0 0 0 4px var(--black-90);
338
377
  }
339
378
 
340
379
  /* color-form */
341
380
  .color-form {
342
381
  display: flex;
343
- flex-direction: row;
344
- flex-wrap: wrap;
382
+ flex-flow: row wrap;
345
383
  align-items: center;
346
384
  padding: .25rem 0 0;
347
385
  font: 12px sans-serif;
@@ -382,27 +420,24 @@ color-picker:focus,
382
420
 
383
421
  /* visual control */
384
422
  .visual-control {
385
- height: 150px;
423
+ height: 230px;
424
+
386
425
  /* important for mobile devices */
387
426
  touch-action: none;
388
427
  box-shadow: var(--visual-shadow);
389
428
  }
390
429
 
391
430
  .visual-control1 {
392
- width: 150px;
431
+ width: 230px;
393
432
  }
433
+
394
434
  .visual-control2,
395
435
  .visual-control3 {
396
436
  width: 21px;
397
437
  cursor: ns-resize;
398
438
  }
399
439
 
400
- @media (min-width: 578px) {
401
- .visual-control { height: 230px; }
402
- .visual-control1 { width: 230px; }
403
- }
404
-
405
- @media (min-width: 1200px) {
440
+ @media (width >= 980px) {
406
441
  .visual-control { height: 300px; }
407
442
  .visual-control1 { width: 300px; }
408
443
  }
@@ -427,7 +462,9 @@ color-picker:focus,
427
462
  position: absolute;
428
463
  top: 0;
429
464
  left: 0;
465
+ width: 100%;
430
466
  height: 7px;
467
+
431
468
  /* important for mobile devices */
432
469
  touch-action: none;
433
470
  user-select: none;
@@ -437,9 +474,11 @@ color-picker:focus,
437
474
  outline: none;
438
475
  will-change: transform;
439
476
  }
477
+
440
478
  .knob:hover {
441
479
  box-shadow: var(--knob-shadow-hover);
442
480
  }
481
+
443
482
  .knob:focus,
444
483
  .knob:active {
445
484
  z-index: 1;
@@ -456,6 +495,7 @@ color-picker:focus,
456
495
  .txt-dark .color-pointer {
457
496
  box-shadow: 0 0 0 5px var(--white-50);
458
497
  }
498
+
459
499
  .txt-light .color-pointer {
460
500
  box-shadow: 0 0 0 5px var(--black-50);
461
501
  }
@@ -463,6 +503,7 @@ color-picker:focus,
463
503
  .txt-dark .color-pointer:hover {
464
504
  box-shadow: 0 0 0 5px var(--white-75);
465
505
  }
506
+
466
507
  .txt-light .color-pointer:hover {
467
508
  box-shadow: 0 0 0 5px var(--black-75);
468
509
  }
@@ -471,6 +512,7 @@ color-picker:focus,
471
512
  .txt-dark .color-pointer:active {
472
513
  box-shadow: 0 0 0 5px var(--white-90);
473
514
  }
515
+
474
516
  .txt-light .color-pointer:focus,
475
517
  .txt-light .color-pointer:active {
476
518
  box-shadow: 0 0 0 5px var(--black-90);