@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.
- package/.eslintrc.cjs +199 -0
- package/.lgtm.yml +9 -0
- package/.prettierrc.json +15 -0
- package/.stylelintrc.json +236 -0
- package/README.md +55 -72
- package/compile.js +51 -0
- package/cypress/e2e/color-palette.cy.ts +128 -0
- package/cypress/e2e/color-picker.cy.ts +909 -0
- package/cypress/fixtures/colorNamesFrench.js +3 -0
- package/cypress/fixtures/componentLabelsFrench.js +21 -0
- package/cypress/fixtures/format.js +3 -0
- package/cypress/fixtures/getMarkup.js +35 -0
- package/cypress/fixtures/getRandomInt.js +6 -0
- package/cypress/fixtures/sampleWebcolors.js +18 -0
- package/cypress/fixtures/testSample.js +8 -0
- package/cypress/plugins/esbuild-istanbul.ts +50 -0
- package/cypress/plugins/tsCompile.ts +34 -0
- package/cypress/support/commands.ts +0 -0
- package/cypress/support/e2e.ts +21 -0
- package/cypress/test.html +23 -0
- package/cypress.config.ts +29 -0
- package/dist/css/color-picker.css +25 -54
- package/dist/css/color-picker.min.css +2 -2
- package/dist/css/color-picker.rtl.css +25 -54
- package/dist/css/color-picker.rtl.min.css +2 -2
- package/dist/js/color-picker.cjs +8 -0
- package/dist/js/color-picker.cjs.map +1 -0
- package/dist/js/color-picker.d.ts +296 -0
- package/dist/js/color-picker.js +5 -3570
- package/dist/js/color-picker.js.map +1 -0
- package/dist/js/color-picker.mjs +2618 -0
- package/dist/js/color-picker.mjs.map +1 -0
- package/dts.config.ts +15 -0
- package/package.json +116 -108
- package/src/scss/_variables.scss +0 -1
- package/src/scss/color-picker.rtl.scss +4 -0
- package/src/scss/color-picker.scss +93 -51
- package/src/ts/colorPalette.ts +89 -0
- package/src/{js/color-picker.js → ts/index.ts} +498 -509
- package/src/ts/interface/ColorNames.ts +20 -0
- package/src/ts/interface/colorPickerLabels.ts +20 -0
- package/src/ts/interface/colorPickerOptions.ts +11 -0
- package/src/ts/interface/paletteOptions.ts +6 -0
- package/src/ts/util/colorNames.ts +21 -0
- package/src/{js/util/colorPickerLabels.js → ts/util/colorPickerLabels.ts} +4 -2
- package/src/ts/util/getColorControls.ts +90 -0
- package/src/{js/util/getColorForm.js → ts/util/getColorForm.ts} +28 -18
- package/src/{js/util/getColorMenu.js → ts/util/getColorMenu.ts} +21 -30
- package/src/ts/util/isValidJSON.ts +19 -0
- package/src/{js/util/setMarkup.js → ts/util/setMarkup.ts} +61 -50
- package/tsconfig.json +29 -0
- package/vite.config.ts +34 -0
- package/dist/js/color-esm.js +0 -1164
- package/dist/js/color-esm.min.js +0 -2
- package/dist/js/color-palette-esm.js +0 -1235
- package/dist/js/color-palette-esm.min.js +0 -2
- package/dist/js/color-palette.js +0 -1243
- package/dist/js/color-palette.min.js +0 -2
- package/dist/js/color-picker-element-esm.js +0 -3718
- package/dist/js/color-picker-element-esm.min.js +0 -2
- package/dist/js/color-picker-element.js +0 -3726
- package/dist/js/color-picker-element.min.js +0 -2
- package/dist/js/color-picker-esm.js +0 -3565
- package/dist/js/color-picker-esm.min.js +0 -2
- package/dist/js/color-picker.min.js +0 -2
- package/dist/js/color.js +0 -1172
- package/dist/js/color.min.js +0 -2
- package/src/js/color-palette.js +0 -75
- package/src/js/color-picker-element.js +0 -107
- package/src/js/color.js +0 -1104
- package/src/js/index.js +0 -8
- package/src/js/util/colorNames.js +0 -6
- package/src/js/util/getColorControls.js +0 -103
- package/src/js/util/isValidJSON.js +0 -13
- package/src/js/util/nonColors.js +0 -5
- package/src/js/util/roundPart.js +0 -9
- package/src/js/util/setCSSProperties.js +0 -12
- package/src/js/util/tabindex.js +0 -3
- package/src/js/util/toggleCEAttr.js +0 -70
- package/src/js/util/version.js +0 -5
- package/src/js/version.js +0 -5
- package/types/cp.d.ts +0 -558
- package/types/index.d.ts +0 -44
- package/types/source/source.ts +0 -4
- package/types/source/types.d.ts +0 -92
- /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": "
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"
|
7
|
-
"
|
8
|
-
"
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
"
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
"
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
"
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
"
|
38
|
-
|
39
|
-
|
40
|
-
"
|
41
|
-
"
|
42
|
-
|
43
|
-
|
44
|
-
"
|
45
|
-
"
|
46
|
-
|
47
|
-
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
"
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
"
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
"
|
79
|
-
"
|
80
|
-
|
81
|
-
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"
|
85
|
-
"
|
86
|
-
"
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
"
|
91
|
-
"
|
92
|
-
"
|
93
|
-
"
|
94
|
-
"
|
95
|
-
"
|
96
|
-
"
|
97
|
-
"
|
98
|
-
"
|
99
|
-
"
|
100
|
-
"
|
101
|
-
"
|
102
|
-
"
|
103
|
-
"
|
104
|
-
"
|
105
|
-
"
|
106
|
-
"
|
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
|
+
}
|
package/src/scss/_variables.scss
CHANGED
@@ -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
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
218
|
-
flex-
|
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
|
-
|
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
|
-
|
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-
|
284
|
-
|
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
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
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
|
-
|
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
|
317
|
-
|
318
|
-
|
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
|
-
|
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
|
-
|
370
|
+
|
371
|
+
.txt-dark .color-options .color-option.active::after {
|
334
372
|
box-shadow: 0 0 0 4px var(--white-90);
|
335
373
|
}
|
336
|
-
|
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-
|
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:
|
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:
|
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 (
|
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);
|