-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
index.css
152 lines (147 loc) · 3.73 KB
/
index.css
1
2
3
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
:root {
--color-color-picker__controls: #000;
--fill-color-picker__controls: 0 0;
--height-color-picker__controls: 10em;
--shadow-color-picker__dialog: 1px 3px 6px rgba(0, 0, 0, .5);
--size-color-picker__controls: 12px;
--stroke-color-picker__controls: #000;
--width-color-picker__control--a: 1.5em;
--width-color-picker__control--h: 1.5em;
--width-color-picker__control--s\/v: 10em;
}
.color-picker__control--a,
.color-picker__control--h,
.color-picker__control--s\/v {
-moz-user-select: none;
-ms-user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-user-select: none;
background-size: 100% 100%;
position: relative;
user-select: none;
}
.color-picker__control--a div,
.color-picker__control--h div,
.color-picker__control--s\/v div {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.color-picker__control--a,
.color-picker__control--h {
border-left: 1px solid;
cursor: ns-resize;
overflow: hidden;
}
.color-picker__control--a {
width: var(--width-color-picker__control--a);
}
.color-picker__control--a div {
z-index: 2;
}
.color-picker__control--a div + div {
background-image: linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd 100%), linear-gradient(45deg, #ddd 25%, #fff 25%, #fff 75%, #ddd 75%, #ddd 100%);
background-position: 0 0, 0.25em 0.25em;
background-size: 0.5em 0.5em;
z-index: 1;
}
.color-picker__control--h {
width: var(--width-color-picker__control--a);
}
.color-picker__control--h div {
background-image: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.color-picker__control--s\/v {
cursor: crosshair;
overflow: hidden;
width: var(--width-color-picker__control--s\/v);
}
.color-picker__control--s\/v div + div {
background-image: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.color-picker__control--s\/v div + div + div {
background-image: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
}
.color-picker__controls {
background: var(--fill-color-picker__controls);
border-radius: var(--arc-color-picker__controls);
border: 1px solid;
border-color: var(--stroke-color-picker__controls);
color: var(--color-color-picker__controls);
display: flex;
height: var(--height-color-picker__controls);
overflow: hidden;
}
.color-picker__dialog {
box-shadow: var(--shadow-color-picker__dialog);
}
.color-picker__dialog,
.color-picker__dialog::before,
.color-picker__dialog::after,
.color-picker__dialog *,
.color-picker__dialog *::before,
.color-picker__dialog *::after {
box-sizing: border-box;
font: inherit;
}
.color-picker__dialog {
left: 0;
position: absolute;
top: 0;
z-index: 9999;
}
.color-picker__cursor {
border-color: inherit;
color: inherit;
font: inherit;
font-size: var(--size-color-picker__controls);
/* Measure the color picker control size by measuring the text size */
}
.color-picker__cursor--a,
.color-picker__cursor--h {
display: block;
height: 0.5em;
left: 0;
position: absolute;
right: 0;
top: -0.25em;
z-index: 2;
}
.color-picker__cursor--a::before,
.color-picker__cursor--h::before {
border: 0.25em solid;
border-bottom-color: transparent;
border-top-color: transparent;
bottom: 0;
content: "";
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.color-picker__cursor--s\/v {
display: block;
height: 0.75em;
position: absolute;
right: -0.375em;
top: -0.375em;
width: 0.75em;
z-index: 2;
}
.color-picker__cursor--s\/v::before {
border-radius: 100%;
border: 1px solid #fff;
bottom: 0;
box-shadow: 0 0 2px #000;
content: "";
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
}