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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
:root {
--accessibility-contrast-swatch-border-color: var(--grey-40);
--learn-more-underline: light-dark(var(--grey-30), var(--grey-50));
:root[forced-colors-adjust] & {
--accessibility-contrast-swatch-border-color: GrayText;
--learn-more-underline: CanvasText;
}
}
#eyedropper-button {
margin-inline-end: 5px;
display: block;
:root[forced-colors-active] & {
border: 1px solid currentColor;
}
}
#eyedropper-button::before {
background-image: url(chrome://devtools/skin/images/command-eyedropper.svg);
}
/* Mix-in classes */
.spectrum-checker {
background-color: #eee;
background-image:
linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
background-size: 12px 12px;
background-position:
0 0,
6px 6px;
/* Make sure that the background color is properly set in High Contrast Mode */
forced-color-adjust: none;
}
.spectrum-box {
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 2px;
background-clip: content-box;
:root[forced-colors-active] & {
border-color: initial;
}
}
/* Elements */
#spectrum-tooltip {
padding: 5px;
}
/**
* Spectrum controls set the layout for the controls section of the color picker.
*/
.spectrum-controls {
display: flex;
justify-content: space-between;
margin-block-start: 10px;
margin-inline-end: 5px;
}
.spectrum-controls {
width: 200px;
}
.spectrum-container {
display: flex;
flex-direction: column;
margin: -1px;
padding-block-end: 6px;
}
/**
* This styles the color preview and adds a checkered background overlay inside of it. The overlay
* can be manipulated using the --overlay-color variable.
*/
.spectrum-color-preview {
--overlay-color: transparent;
border: 1px solid transparent;
border-radius: 50%;
width: 27px;
height: 27px;
background-color: #fff;
background-image:
linear-gradient(var(--overlay-color), var(--overlay-color)), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%);
background-size: 12px 12px;
background-position:
0 0,
6px 6px;
/* Make sure that the background color is properly set in High Contrast Mode */
forced-color-adjust: none;
:root[forced-colors-active] & {
border-color: CanvasText;
}
}
.spectrum-color-preview.high-luminance {
border-color: #ccc;
}
.spectrum-slider-container {
display: flex;
flex-direction: column;
justify-content: space-around;
width: 130px;
margin-inline-start: 10px;
height: 30px;
}
/* Keep aspect ratio:
http://www.briangrinstead.com/blog/keep-aspect-ratio-with-html-and-css */
.spectrum-color-picker {
position: relative;
width: 205px;
height: 120px;
/* Make sure that the background color is properly set in High Contrast Mode */
forced-color-adjust: none;
}
.spectrum-color {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 100%;
}
.spectrum-sat,
.spectrum-val {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.spectrum-alpha {
margin-block-start: 3px;
}
.spectrum-alpha,
.spectrum-hue {
position: relative;
height: 8px;
}
.spectrum-alpha-input,
.spectrum-hue-input {
width: 100%;
margin: 0;
position: absolute;
height: 8px;
border-radius: 2px;
direction: initial;
}
.spectrum-hue-input,
.spectrum-alpha-input {
outline-offset: 4px;
}
.spectrum-hue-input::-moz-range-thumb,
.spectrum-alpha-input::-moz-range-thumb {
cursor: pointer;
height: 12px;
width: 12px;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
background: #fff;
border-radius: 50%;
opacity: 0.9;
border: none;
}
:root[forced-colors-active] :is(.spectrum-hue-input, .spectrum-alpha-input)::-moz-range-thumb {
background: ButtonFace;
border: 2px solid ButtonText;
}
:root[forced-colors-active] :is(.spectrum-hue-input, .spectrum-alpha-input):is(:hover, :focus-visible)::-moz-range-thumb {
border-color: SelectedItem;
}
.spectrum-hue-input::-moz-range-track {
border-radius: 2px;
height: 8px;
background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
/* Make sure that the background color is properly set in High Contrast Mode */
forced-color-adjust: none;
}
.spectrum-sat {
background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
}
.spectrum-val {
background-image: linear-gradient(to top, #000000, rgba(204, 154, 129, 0));
}
.spectrum-dragger {
user-select: none;
position: absolute;
top: 0;
left: 0;
cursor: pointer;
border-radius: 50%;
height: 8px;
width: 8px;
border: 1px solid white;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}
.spectrum-color-contrast {
padding-block-start: 8px;
padding-inline-start: 4px;
padding-inline-end: 4px;
line-height: 1.2em;
}
.contrast-ratio-header-and-single-ratio,
.contrast-ratio-range {
display: flex;
align-items: stretch;
}
.contrast-ratio-range {
margin-block-start: 4px;
margin-inline-start: 1px;
margin-block-end: 2px;
}
.spectrum-color-contrast.visible {
display: block;
color: var(--theme-text-color-strong);
}
.spectrum-color-contrast.visible:not(.range) .contrast-ratio-single,
.spectrum-color-contrast.visible.range .contrast-ratio-range {
display: flex;
}
.spectrum-color-contrast,
.spectrum-color-contrast .contrast-ratio-range,
.spectrum-color-contrast.range .contrast-ratio-single,
.spectrum-color-contrast.error .accessibility-color-contrast-separator,
.spectrum-color-contrast.error .contrast-ratio-max {
display: none;
}
.contrast-ratio-label {
font-size: 10px;
padding-inline-end: 4px;
}
.spectrum-color-contrast .accessibility-contrast-value {
font-size: 10px;
border-bottom: 1px solid var(--learn-more-underline);
/* opt-out of forced colors to avoid the blackplaing that clips the border */
forced-color-adjust: none;
}
.spectrum-color-contrast.visible:not(.error) .contrast-ratio-single .accessibility-contrast-value {
margin-inline-start: 10px;
}
.spectrum-color-contrast.visible:not(.error) .contrast-ratio-min .accessibility-contrast-value,
.spectrum-color-contrast.visible:not(.error) .contrast-ratio-max .accessibility-contrast-value {
margin-inline-start: 7px;
}
.spectrum-color-contrast .accessibility-contrast-value:not(:empty)::before {
width: auto;
content: none;
padding-inline-start: 2px;
}
.spectrum-color-contrast.visible:not(.error) .contrast-value-and-swatch:before {
display: inline-flex;
content: "";
height: 9px;
width: 9px;
background-color: var(--accessibility-contrast-color);
/* opt-out of forced color so we can actually see the colors */
forced-color-adjust: none;
}
.spectrum-color-contrast.visible:not(.error):-moz-locale-dir(ltr) .contrast-value-and-swatch:before {
box-shadow:
0 0 0 1px var(--accessibility-contrast-swatch-border-color),
6px 5px var(--accessibility-contrast-bg),
6px 5px 0 1px var(--accessibility-contrast-swatch-border-color);
}
.spectrum-color-contrast.visible:not(.error):-moz-locale-dir(rtl) .contrast-value-and-swatch:before {
box-shadow:
0 0 0 1px var(--accessibility-contrast-swatch-border-color),
-6px 5px var(--accessibility-contrast-bg),
-6px 5px 0 1px var(--accessibility-contrast-swatch-border-color);
}
.spectrum-color-contrast .accessibility-color-contrast-separator:before {
margin-inline-end: 4px;
color: var(--theme-body-color);
}
.spectrum-color-contrast .accessibility-color-contrast-large-text {
margin-inline: 1px;
unicode-bidi: isolate;
}
.learn-more {
background-repeat: no-repeat;
-moz-context-properties: fill;
background-image: url(resource://devtools-shared-images/info-small.svg);
background-color: transparent;
fill: var(--theme-icon-dimmed-color);
border: none;
margin-inline-start: auto;
margin-block-start: 1px;
aspect-ratio: 1 / 1;
width: 12px;
}
.learn-more:-moz-locale-dir(ltr) {
margin-inline-end: -5px;
}
.learn-more:-moz-locale-dir(rtl) {
margin-inline-end: -2px;
}
.learn-more:hover,
.learn-more:focus {
fill: var(--theme-icon-hover-color);
cursor: pointer;
outline: none;
}
|