-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstyle.css
156 lines (130 loc) · 2.84 KB
/
style.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
153
154
155
156
:root {
--transparency: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill-opacity=".05"><rect width="50" height="50" /><rect x="50" y="50" width="50" height="50" /></svg>')
0 0 / 20px 20px #f8f8f8;
}
body {
display: flex;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
height: 100vh;
padding: 1em 2em;
margin: 0;
font: 100%/1.6 Helvetica Neue, sans-serif;
background: var(--transparency);
}
header {
align-items: center;
line-height: 1;
letter-spacing: -.05em;
}
main {
padding: 1.5em;
border-radius: .5em;
width: 40em;
max-width: 90vw;
margin: 1em auto;
background: #f0f0f0;
box-shadow: .05em .05em .1em rgba(0,0,0,.2), 0 0 0 100vmax var(--color);
opacity: 0;
&:has(color-picker:defined) {
opacity: 1;
/* We add the 0.3s delay to let the `<color-picker>` components settle down. */
transition: opacity .25s .3s;
}
}
color-picker {
/* Don't allow content to stretch the grid */
grid-template-columns: min-max(0, 1fr);
&::part(color-space) {
box-sizing: content-box;
inline-size: calc(100% - .2em);
padding: 0;
margin: 0;
border: .1em solid hsl(220 10% 60%);
font-size: 250%;
font-weight: 700;
field-sizing: initial;
}
&::part(color-space-base) {
inline-size: 100%;
block-size: 100%;
padding: 0;
margin: 0;
font-size: 120%;
field-sizing: initial;
text-overflow: ellipsis;
}
&::part(sliders),
&::part(details) {
grid-column: 1 / -1;
}
&::part(channel-slider) {
text-transform: uppercase;
font-size: smaller;
font-weight: bold;
color: rgb(0 0 0 / .5);
}
&::part(swatch) {
/* We need the gamut badge to be placed absolutely relative to the body, not the color swatch */
display: contents;
}
&::part(swatch-base) {
display: none;
}
&::part(gamut) {
font-size: clamp(1rem, 2vw, 1.5rem);
}
}
fieldset {
border: 1px solid hsl(220 10% 80%);
border-radius: .3em;
margin: 0;
margin-top: 1em;
}
label,
legend {
display: block;
text-transform: uppercase;
font-size: smaller;
margin-top: 1em;
font-weight: bold;
color: rgba(0,0,0,.5);
}
abbr {
text-transform: initial;
}
input.color-css,
input.color-srgb {
padding: .3em .5em .2em;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: .3em;
box-shadow: 0 0.05em 0.2em rgba(0, 0, 0, 0.2) inset;
background: rgba(26, 26, 26, 0.05);
width: 100% !important;
box-sizing: border-box;
font: 150% Consolas, Monaco, monospace;
}
.out-of-gamut input {
border-color: rgba(200, 0, 0, 0.5);
}
.out-of-gamut-warning {
margin-top: .4em;
color: #b00;
font-weight: bold;
font-size: smaller;
text-transform: initial;
}
.out-of-gamut-warning::before {
content: "⚠️ ";
filter: invert() hue-rotate(-200deg);
}
label:not(.out-of-gamut) .out-of-gamut-warning {
display: none;
}
.precision input {
font: inherit;
color: inherit;
background: none;
border: none;
}