File: inspector-swatches.css

package info (click to toggle)
firefox 147.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,532 kB
  • sloc: cpp: 7,607,356; javascript: 6,533,348; ansic: 3,775,236; python: 1,415,508; xml: 634,561; asm: 438,949; java: 186,241; sh: 62,760; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (179 lines) | stat: -rw-r--r-- 5,353 bytes parent folder | download | duplicates (4)
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
/* 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/. */

/* Style swatches as rendered by the OutputParser. This needs to be in a shared file as
   those classes are used in the Rules view and the CSS variable tooltip. */

.inspector-flex,
.inspector-grid,
.inspector-shapeswatch,
.inspector-swatch {
  --swatch-size: 1em;
  width: var(--swatch-size);
  height: var(--swatch-size);
  vertical-align: middle;

  /* align the swatch with its value */
  margin-top: -1px;
  margin-inline-end: 5px;
  display: inline-block;
  position: relative;

  /* Set pointer cursor when swatch is interactive */
  &:is(button, [role="button"]) {
    cursor: pointer;
  }
}

/* Icon swatches not using the .inspector-swatch class (flex, grid, shape) */

.inspector-flex,
.inspector-grid,
.inspector-shapeswatch {
  background-color: transparent;
  border: none;
  -moz-context-properties: stroke;
  stroke: var(--theme-icon-color);
  /* Prevent line break when copy/pasting an entire rule */
  user-select: auto;

  &:hover {
    stroke: var(--theme-icon-alternate-hover-color);
  }
}

:is(.inspector-flex, .inspector-grid, .inspector-shapeswatch)[aria-pressed="true"] {
  background-color: var(--theme-toolbarbutton-checked-background);
  stroke: var(--theme-toolbarbutton-checked-color);
}

.inspector-flex {
  background-image: url("chrome://devtools/skin/images/flexbox-swatch.svg");
  background-size: 13px 11px;
  width: 13px;
  height: 11px;
}

.inspector-grid {
  background-image: url("chrome://devtools/skin/images/grid.svg");
}

.inspector-grid[disabled] {
  cursor: default;
  opacity: 0.5;
}

.inspector-shapeswatch {
  background-image: url("chrome://devtools/skin/images/shape-swatch.svg");
  background-size: 110%;
  width: 1.45em;
  height: 1.45em;
}

.inspector-shape-point.active,
.inspector-shapeswatch[aria-pressed="true"] + .inspector-shape > .inspector-shape-point:hover {
  background-color: var(--inspector-highlight-background-color);
  color: var(--inspector-highlight-color);
  /* Add an outline so when the property is highlighted because of search,
     the active point still stands out */
  outline: 1px solid var(--theme-contrast-border);
}

.inspector-variable {
  color: var(--theme-highlight-blue);
}

/* Round swatches using the .inspector-swatch class (color, bezier, filter and angle) */

.inspector-swatch {
  background-size: var(--swatch-size);
  border-radius: 50%;
  box-shadow: 0 0 0 1px light-dark(#c4c4c4, #818181);

  :root[forced-colors-active] &:not(:focus-visible) {
    /* The box-shadow isn't rendered in High Contrast Mode, and we do want to have a "border"
       for those without impacting the size of the elements */
    outline: 1px solid var(--theme-icon-color);

    &:hover {
      outline-color: var(--theme-icon-hover-color);
    }
  }
}

/* Create a stacking context for the color swatch so its before pseudo element can be
   display below it (see next rule) */
.color-swatch-container {
  position: relative;
  z-index: 1;
}

/* We want to display a checker below the current swatch color that would be visible
  if the swatch color isn't opaque */
.inspector-colorswatch::before {
  content: "";
  background-color: #eee;
  --checker-color: #ccc;
  --background-gradient: linear-gradient(45deg, var(--checker-color) 25%, transparent 25% 75%, var(--checker-color) 75%);
  background-image: var(--background-gradient), var(--background-gradient);
  background-size: var(--swatch-size) var(--swatch-size);
  background-position:
    0 0,
    calc(var(--swatch-size) / 2) calc(var(--swatch-size) / 2);
  position: absolute;
  border-radius: 50%;
  inset: 0;
  z-index: -1;
}

.inspector-swatch.inspector-colorswatch {
  border: none;
  padding: 0;
  /* Adjust outline so it doesn't conflate with the color swatch, which could have a similar background
     color as the outline */
  outline-offset: 2px;
  /* Make sure that the background color is properly set in High Contrast Mode */
  forced-color-adjust: none;
}

.inspector-bezierswatch {
  background-image: url("chrome://devtools/skin/images/cubic-bezier-swatch.svg");
  -moz-context-properties: stroke, fill;
  fill: #fff;
  stroke: #808080;
}

.inspector-filterswatch {
  background-image: url("chrome://devtools/skin/images/filter-swatch.svg");
  -moz-context-properties: stroke, fill;
  fill: #fff;
  stroke: #aeb0b1;
}

.inspector-angleswatch {
  background-image: url("chrome://devtools/skin/images/angle-swatch.svg");
  -moz-context-properties: stroke, fill;
  fill: #fff;
  stroke: #aeb0b1;
}

.inspector-lineareasingswatch {
  background-image: url("chrome://devtools/skin/images/linear-easing-swatch.svg");
  -moz-context-properties: stroke, fill;
  fill: #fff;
  stroke: #808080;
}

:root[forced-colors-active] :is(.inspector-bezierswatch, .inspector-lineareasingswatch, .inspector-filterswatch, .inspector-angleswatch) {
  fill: ButtonFace;
  stroke: var(--theme-icon-color);
  /* For some icons, the outline can conflate with the background image in a weird way
     on low-dpi screens. Adjust the offset a bit so there's a clear separation between
     the icon and the outline for a cleaner look */
  outline-offset: 1px;

  &:hover {
    stroke: var(--theme-icon-hover-color);
  }
}