1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /* CSS Variables specific to this panel that aren't defined by the themes */
7 --rule-highlight-background-color: var
(--theme-highlight-yellow
);
8 --rule-highlight-propertyname: var
(--blue-60
);
9 --rule-highlight-propertyvalue: var
(--magenta-70
);
10 --rule-highlight-unmatched-unused-color: var
(--grey-55
);
11 --rule-header-background-color: var
(--theme-toolbar-background
);
12 --rule-computed-margin-inline-start: 35px;
13 --rule-enableproperty-size: 12px;
14 --rule-enableproperty-margin-inline-start: 3px;
15 --rule-enableproperty-margin-inline-end: 9px;
17 &:is
([platform
="win"], [platform
="linux"]) {
18 --rule-enableproperty-size: 14px;
19 /* it's important to keep the px unit here as this is used in a `calc()` */
20 --rule-enableproperty-margin-inline-start: 0px;
21 --rule-enableproperty-margin-inline-end: 10px;
26 --rule-highlight-background-color: #521C76;
27 --rule-highlight-propertyname: var
(--theme-highlight-blue
);
28 --rule-highlight-propertyvalue: var
(--theme-highlight-red
);
29 --rule-highlight-unmatched-unused-color: var
(--grey-40
);
30 --rule-header-background-color: #222225;
33 /* Rule View Tabpanel */
35 #sidebar-panel-ruleview {
38 flex-direction: column
;
42 /* Override the min-width from .inspector-tabpanel, as the rule panel can support small
47 /* Rule View Toolbar */
49 #ruleview-toolbar-container {
50 line-height: var
(--theme-toolbar-height
);
58 #ruleview-toolbar .devtools-searchbox
{
60 height: var
(--theme-toolbar-height
);
63 #ruleview-command-toolbar {
67 .ruleview-reveal-panel {
68 border-bottom: 1px solid var
(--theme-splitter-color
);
75 .ruleview-reveal-panel[hidden] {
79 .ruleview-reveal-panel .add-class {
80 height: var
(--theme-toolbar-height
);
84 .ruleview-reveal-panel label {
91 #ruleview-class-panel .classes
{
95 /* Pseudo Class toggle panel */
98 grid-template-columns: repeat
(auto-fit
, minmax
(100px, max-content
));
101 #pseudo-class-panel:not
([hidden
]) {
105 /* Class toggle panel */
107 #ruleview-class-panel {
108 flex-direction: column
;
111 #ruleview-class-panel .classes
{
112 border-top: 1px solid var
(--theme-splitter-color
);
120 #ruleview-class-panel .classes label
{
126 #ruleview-class-panel .classes label span
{
128 text-overflow: ellipsis
;
132 #ruleview-class-panel .no-classes
{
134 color: var
(--theme-text-color-inactive
);
139 /* Rule View Container */
141 #ruleview-container {
146 /* Adjust outline so it's visible */
147 outline-offset: -2px;
150 /* This extra wrapper only serves as a way to get the content of the view focusable.
151 So that when the user reaches it either via keyboard or mouse, we know that the view
152 is focused and therefore can handle shortcuts.
153 However, for accessibility reasons, tabindex is set to -1 to avoid having to tab
154 through it, and the outline is hidden. */
155 #ruleview-container-focusable {
160 #ruleview-container.non-interactive
{
161 pointer-events: none
;
162 visibility: collapse
;
163 transition: visibility
0.25s;
166 #ruleview-container .accordion
._content
{
170 .ruleview-property:not(:hover) > .ruleview-enableproperty {
171 pointer-events: none
;
174 .ruleview-expandable-container {
178 .ruleview-namecontainer {
183 margin-inline-start: var
(--rule-computed-margin-inline-start
);
184 /* Add a small indent for wrapping lines */
185 text-indent: 1em hanging
;
188 .ruleview-computed > .ruleview-namecontainer {
192 .ruleview-propertyvaluecontainer {
197 .ruleview-propertyvaluecontainer a {
198 color: var
(--theme-highlight-purple
);
202 .ruleview-computedlist
,
203 .ruleview-expandable-container
[hidden
],
204 .ruleview-overridden-items
[hidden
],
205 .ruleview-overridden-rule-filter
[hidden
],
206 .ruleview-warning
[hidden
],
207 .ruleview-unused-warning
[hidden
],
208 .ruleview-compatibility-warning
[hidden
],
209 .ruleview-used
[hidden
],
210 .ruleview-overridden .ruleview-grid {
214 .ruleview-computedlist
[user-open
],
215 .ruleview-computedlist
[filter-open
],
216 .ruleview-overridden-items {
220 .ruleview-rule-source {
225 /* Force RTL direction to crop the source link at the beginning. */
228 text-overflow: ellipsis
;
235 .ruleview-rule-source-label {
240 /* Create an LTR embed to avoid special characters being shifted to the start due to the
241 parent node direction: rtl; */
246 .ruleview-rule-source
.disabled
> .ruleview-rule-source-label
,
247 .ruleview-rule-source[unselectable] > .ruleview-rule-source-label {
251 .ruleview-rule-source:not([unselectable]) {
252 text-decoration: underline
;
253 text-decoration-skip-ink: none
;
257 --ruleview-header-padding: 4px;
258 background: var
(--rule-header-background-color
);
259 border-bottom: 1px solid var
(--theme-splitter-color
);
260 color: var
(--theme-toolbar-color
);
263 padding: var
(--ruleview-header-padding
);
270 .ruleview-expandable-header {
272 /* Reset padding set on ruleview-header since we're going to put it on the button instead */
276 background-color: var
(--theme-accordion-header-hover
);
279 & button
[aria-expanded
] {
281 /* Space between arrow and label */
284 padding: var
(--ruleview-header-padding
);
285 /* Reset button-specific styles */
286 background-color: transparent
;
289 /* Apply same font-size as set on ruleview-header */
291 outline-offset: -2px;
293 &[aria-expanded
="true"] .theme-twisty
{
299 .ruleview-rule-pseudo-element {
301 border-left: solid
10px;
305 border-bottom: 1px solid var
(--theme-splitter-color
);
310 #ruleview-container-focusable > .ruleview-rule:last-child
{
315 * Display rules that don't match the current selected element and uneditable
316 * user agent styles differently
318 .ruleview-rule
.unmatched
,
319 .ruleview-rule
.uneditable
,
320 .ruleview-rule
[unmatched
=true
],
321 .ruleview-rule[uneditable=true] {
322 background: var
(--theme-tab-toolbar-background
);
325 .ruleview-rule
.unmatched
,
326 .ruleview-rule[unmatched=true] {
330 .ruleview-rule
.uneditable :focus
,
331 .ruleview-rule[uneditable=true] :focus {
335 .ruleview-rule
.uneditable
.theme-link
,
336 .ruleview-rule[uneditable=true] .theme-link {
337 color: var
(--theme-highlight-bluegrey
);
340 .ruleview-rule
.uneditable
.ruleview-enableproperty
,
341 .ruleview-rule[uneditable=true] .ruleview-enableproperty {
345 .ruleview-rule
.uneditable
.ruleview-swatch
,
346 .ruleview-rule[uneditable=true] .ruleview-swatch {
350 .ruleview-rule
.uneditable
.ruleview-namecontainer
> .ruleview-propertyname
,
351 .ruleview-rule
.uneditable
.ruleview-propertyvaluecontainer
>
352 .ruleview-propertyvalue
,
353 .ruleview-rule
[uneditable
=true
] .ruleview-namecontainer
> .ruleview-propertyname
,
354 .ruleview-rule
[uneditable
=true
] .ruleview-propertyvaluecontainer
>
355 .ruleview-propertyvalue {
356 border-bottom-color: transparent
;
359 .ruleview-overridden-rule-filter {
360 display: inline-block
;
363 margin-inline-start: 3px;
364 background-image: url
(chrome://devtools
/skin
/images
/filter-small
.svg
);
365 background-position: center
;
366 background-repeat: no-repeat
;
367 background-size: 12px;
368 -moz-context-properties: fill
;
369 fill: var
(--theme-icon-dimmed-color
);
370 background-color: transparent
;
373 &:is
(:hover
, :focus-visible
) {
374 fill: var
(--theme-icon-color
);
379 padding-inline-end: 5px;
382 .ruleview-ruleclose {
388 .ruleview-ancestor-ruleopen
,
389 .ruleview-ancestor-ruleclose {
390 color: var
(--theme-comment
);
393 .ruleview-rule-indent, .ruleview-ancestor-ruleclose {
396 * We do want to keep the underlying chars for the indent for user to copy/paste,
397 * but we can reduce the inline space it takes.
398 * Tweaking word-spacing instead of using font-size as the latter could be odd when
399 * the text is selected.
400 * Avoid using letter-spacing as this can cause visual glitches on low-dpi screen (see Bug 1845517).
402 word-spacing: -0.5ch;
405 .ruleview-rule-indent.clipboard-only {
416 .ruleview-propertylist {
422 .ruleview-expandable-container.registered-properties .ruleview-propertylist {
423 /* Since we don't have a toggle checkbox for registered property definitions, we set
424 a padding so they have the same indent as properties in regular rules */
425 padding-inline-start: 28px;
428 .ruleview-enableproperty {
434 .ruleview-enableproperty {
435 box-sizing: border-box
;
436 margin-inline-start: var
(--rule-enableproperty-margin-inline-start
);
437 margin-inline-end: var
(--rule-enableproperty-margin-inline-end
);
438 width: var
(--rule-enableproperty-size
);
439 height: var
(--rule-enableproperty-size
);
441 /* The SVG checkbox on Windows and Linux */
442 :root:is
([platform
="win"], [platform
="linux"]) & {
445 box-sizing: content-box
;
446 display: inline-block
;
449 background: url
("chrome://devtools/skin/images/checkbox.svg") center no-repeat content-box
;
450 /* Using fill to paint the border, and stroke for the tick */
451 -moz-context-properties: fill
, stroke
;
452 fill: rgba
(0,0,0,.3);
456 :root
[platform
="mac"] & {
458 -moz-default-appearance: checkbox
;
462 :root
[platform
="win"].theme-dark
.ruleview-enableproperty
,
463 :root
[platform
="linux"].theme-dark
.ruleview-enableproperty
{
464 fill: rgba
(255,255,255,.4);
467 :root
[platform
="win"] .ruleview-enableproperty:checked
,
468 :root
[platform
="linux"] .ruleview-enableproperty:checked
{
469 stroke: rgba
(0,0,0,.6);
472 :root
[platform
="win"].theme-dark
.ruleview-enableproperty:checked
,
473 :root
[platform
="linux"].theme-dark
.ruleview-enableproperty:checked
{
474 stroke: rgba
(255,255,255,.8);
478 .ruleview-unused-warning
,
479 .ruleview-compatibility-warning {
480 display: inline-block
;
483 background-size: 12px;
484 background-repeat: no-repeat
;
485 -moz-context-properties: fill
;
489 background-image: url
(resource://devtools-shared-images
/alert-small
.svg
);
490 fill: var
(--yellow-60
);
493 .ruleview-unused-warning {
494 background-image: url
(resource://devtools-shared-images
/info-small
.svg
);
495 background-color: var
(--theme-sidebar-background
);
496 fill: var
(--theme-icon-dimmed-color
);
499 .ruleview-compatibility-warning {
500 background-image: url
(chrome://devtools
/skin
/images
/report
.svg
);
501 background-color: var
(--theme-sidebar-background
);
502 fill: var
(--theme-icon-dimmed-color
);
505 .ruleview-unused-warning:hover
,
506 .ruleview-compatibility-warning:hover {
507 fill: var
(--theme-icon-color
);
508 stroke: var
(--theme-icon-color
);
511 .ruleview-rule:not(:hover, :focus-within) .ruleview-enableproperty {
512 /* Use opacity to hide the checkbox instead of visibility:hidden,
513 so that it's possible to focus it with the keyboard. */
518 vertical-align: middle
;
521 .ruleview-propertycontainer .ruleview-expander {
525 .ruleview-propertycontainer .ruleview-expander:dir(rtl):not([open]) {
526 /* for preventing .theme-twisty's wrong direction in rtl; Bug 1296648 */
527 transform: rotate
(-90deg);
530 .ruleview-newproperty {
531 /* As we don't have the checkbox displayed before the input, we need to align it
532 with the property name above it. */
533 margin-inline-start: calc
(
534 var
(--rule-enableproperty-size
) +
535 var
(--rule-enableproperty-margin-inline-start
) +
536 var
(--rule-enableproperty-margin-inline-end
)
540 .ruleview-namecontainer
,
541 .ruleview-propertyvaluecontainer
,
542 .ruleview-propertyname
,
543 .ruleview-propertyvalue {
544 text-decoration: inherit
;
547 .ruleview-computedlist {
552 .ruleview-overridden-items {
558 .ruleview-overridden-item {
562 .ruleview-overridden-item::before
,
563 .ruleview-overridden-item::after {
567 border: 0 solid var
(--theme-text-color-alt
);
570 .ruleview-overridden-item::before {
575 border-left-width: 0.5px;
576 border-bottom-width: 0.5px;
579 .ruleview-overridden-item::after {
583 border-left-width: 0.5px;
586 .ruleview-overridden-item:last-child::after {
590 .ruleview-overridden-item .ruleview-namecontainer {
598 .ruleview-shapeswatch
,
603 vertical-align: middle
;
605 /* align the swatch with its value */
607 margin-inline-end: 5px;
608 display: inline-block
;
612 /* Icon swatches not using the .ruleview-swatch class (flex, grid, shape) */
616 .ruleview-shapeswatch {
617 -moz-context-properties: stroke
;
618 stroke: var
(--theme-icon-color
);
621 .ruleview-flex
.active
,
622 .ruleview-grid
.active
,
623 .ruleview-shapeswatch.active {
624 stroke: var
(--theme-icon-checked-color
);
628 background-image: url
("chrome://devtools/skin/images/flexbox-swatch.svg");
629 background-size: 13px 11px;
635 background-image: url
("chrome://devtools/skin/images/grid.svg");
638 .ruleview-grid[disabled] {
643 .ruleview-shapeswatch {
644 background-image: url
("chrome://devtools/skin/images/shape-swatch.svg");
645 background-size: 110%;
650 .ruleview-shape-point
.active
,
651 .ruleview-shapeswatch.active + .ruleview-shape > .ruleview-shape-point:hover {
652 background-color: var
(--rule-highlight-background-color
);
655 /* Round swatches using the .ruleview-swatch class (color, bezier, filter and angle) */
658 background-size: 1em;
662 .ruleview-colorswatch::before {
664 background-color: #eee;
665 background-image: linear-gradient
(45deg, #ccc 25%, transparent
25%, transparent
75%, #ccc 75%, #ccc),
666 linear-gradient
(45deg, #ccc 25%, transparent
25%, transparent
75%, #ccc 75%, #ccc);
667 background-size: 12px 12px;
668 background-position: 0 0, 6px 6px;
678 .ruleview-swatch.ruleview-colorswatch {
681 /* Adjust outline so it doesn't conflate with the color swatch, which could have a similar background
682 color as the outline */
686 .ruleview-bezierswatch {
687 background-image: url
("chrome://devtools/skin/images/cubic-bezier-swatch.svg");
690 .ruleview-filterswatch {
691 background-image: url
("chrome://devtools/skin/images/filter-swatch.svg");
694 .ruleview-angleswatch {
695 background-image: url
("chrome://devtools/skin/images/angle-swatch.svg");
698 .ruleview-lineareasingswatch {
699 background-image: url
("chrome://devtools/skin/images/linear-easing-swatch.svg");
702 .ruleview-overridden {
703 text-decoration: line-through solid var
(--theme-text-color-alt
);
707 * Hide swatches (tool icons) from properties that are overwritten by higher specificity * rules.
708 * .ruleview-swatch is a base class for many tool swatches (shapes, color, bezier curves)
709 * .ruleview-flex and .ruleview-grid are custom
711 .ruleview-overridden
.ruleview-flex
,
712 .ruleview-overridden
.ruleview-grid
,
713 .ruleview-overridden
.ruleview-shapeswatch
,
714 .ruleview-overridden .ruleview-swatch {
718 .ruleview-font-family.used-font {
719 text-decoration: underline
;
722 .styleinspector-propertyeditor {
728 /* Unset the outline box shadow to prevent overlapping previous/next properties.
729 This is safe since those input won't be this part of the UI won't get */
730 --theme-outline-box-shadow: initial
;
735 border-left: 3px solid transparent
;
737 overflow-wrap: break-word
;
738 /* When the text of the property wraps, we want the wrapping lines to have an indent so
739 they don't go under the checkbox */
740 text-indent: var
(--rule-computed-margin-inline-start
) hanging
;
743 .ruleview-propertycontainer > * {
744 vertical-align: middle
;
747 .ruleview-property
.ruleview-changed
,
748 .ruleview-property[dirty] {
749 border-left-color: var
(--theme-highlight-green
);
752 .ruleview-highlight {
754 * If we'd rely solely on background color change for highlighted element, we would need
755 * to pick a color that would bring at least 3:1 ratio (see 1.4.11 Non-text Contrast).
756 * As this would be too disturbing for the user, we need to indicate impacted element
757 * with another graphical mean.
758 * So here we'll use a bottom box-shadow (not a border to avoid impacting the layout)
759 * which will match the style we have in Debugger for search results.
761 background-color: var
(--rule-highlight-background-color
);
762 /* Put the box-shadow inside the element so it's still visible when sibling elements are highlighted */
763 box-shadow: inset
0px -1px 0px 0px var
(--theme-contrast-border
);
766 /* property name and value and unmatched/inactive colors need to be adjusted
767 in order to have enough contrast against the highlighted background */
768 & .ruleview-propertyname
{
769 color: var
(--rule-highlight-propertyname
);
772 & .ruleview-propertyvalue
{
773 color: var
(--rule-highlight-propertyvalue
);
776 &.ruleview-selector
.unmatched
,
777 & .ruleview-unmatched-variable
,
778 .ruleview-property:is(.unused, .ruleview-overridden) & :is(.ruleview-propertyname, .ruleview-propertyvalue) {
779 color: var
(--rule-highlight-unmatched-unused-color
);
783 .ruleview-namecontainer
> .ruleview-propertyname
,
784 .ruleview-propertyvaluecontainer > .ruleview-propertyvalue {
785 border-bottom: 1px dashed transparent
;
788 .ruleview-namecontainer:hover
> .ruleview-propertyname
,
789 .ruleview-propertyvaluecontainer:hover > .ruleview-propertyvalue {
790 border-bottom-color: hsl
(0,0%,50%);
793 /* ancestor rules info element (parent at-rules, parent of nested rules, …) */
794 .ruleview-rule-ancestor-data {
796 display: inline-block
;
802 .ruleview-rule-ancestor-data [role="listitem"] {
803 /* When there's a search and this element is highlighted, this prevents the background
804 color to be applied to the whole width of the parent ul block */
805 max-width: max-content
;
808 .ruleview-rule-ancestor-data [role="listitem"].has-tooltip:hover .container-query-declaration {
809 text-decoration: underline
;
810 text-decoration-color: var
(--theme-highlight-blue
);
811 text-decoration-style: dotted
;
812 text-decoration-skip-ink: none
;
813 text-decoration-thickness: 2px;
814 text-underline-offset: 2px;
817 .ruleview-rule-ancestor-data [role="listitem"] :is(button,[role="button"]).open-inspector {
818 /* There's a space character after the button, so add a 1ch margin-inline-start to be consistent */
819 margin-inline: 1ch 0;
822 .ruleview-selectors-container
,
823 .ruleview-registered-property-name {
824 word-wrap: break-word
;
829 color: var
(--theme-highlight-blue
);
832 .ruleview-selector-separator
,
833 .ruleview-selector
.unmatched
,
834 .ruleview-unmatched-variable
,
835 .ruleview-property:is(.unused, .ruleview-overridden) :is(.ruleview-propertyname,.ruleview-propertyvalue) {
836 color: var
(--theme-text-color-alt
);
839 /* We use a dimmer color for those unmatching element, but we can't convey state change
840 only with colors, so let's add a line-through line */
842 .ruleview-selector
.unmatched
,
843 .ruleview-unmatched-variable
845 /* don't show the strike through when the element is hovered so it's more legible */
848 text-decoration: line-through solid currentColor
;
851 .ruleview-selector.matched > .ruleview-selector-attribute {
852 /* TODO: Bug 1178535 Awaiting UX feedback on highlight colors */
855 .ruleview-selector.matched > .ruleview-selector-pseudo-class {
856 /* TODO: Bug 1178535 Awaiting UX feedback on highlight colors */
859 .ruleview-selector.matched > .ruleview-selector-pseudo-class-lock {
860 color: var
(--pseudo-class-text-color
);
863 .ruleview-selector-warnings {
864 display: inline-block
;
867 margin-inline-start: 2px;
868 vertical-align: text-top
;
871 border: 1px solid var
(--theme-warning-border
);
872 background-color: var
(--theme-warning-background
);
873 background-repeat: no-repeat
;
874 background-position: center
;
875 fill: var
(--theme-warning-color
);
876 -moz-context-properties: fill
;
878 /* Default warning icon */
879 background-image: url
(resource://devtools-shared-images
/alert-small
.svg
);
880 background-size: 10px;
883 background-image: url
(chrome://devtools
/content
/netmonitor
/src
/assets
/icons
/turtle
.svg
);
884 background-size: 12px;
888 /* When hovering the selector warnings icon, highlight the selector it applies to */
889 .ruleview-selector:has(.ruleview-selector-warnings:hover) {
890 background-color: var
(--theme-warning-background
);
891 /* We're not using --theme-warning-border to make it more visible */
892 outline: 1px solid var
(--theme-warning-color
);
894 & .ruleview-selector-warnings
{
895 /* In such case, hide the icon border to make it cleaner */
896 border-color: transparent
;
900 .ruleview-selectorhighlighter {
901 display: inline-block
;
907 background: url
("chrome://devtools/skin/images/highlight-selector.svg") no-repeat
0 0;
908 background-size: contain
;
910 -moz-context-properties: fill
;
911 fill: var
(--theme-icon-dimmed-color
);
912 /* Prevent line break when copy/pasting an entire rule */
916 .ruleview-selectorhighlighter:hover {
917 fill: var
(--theme-icon-color
);
920 .ruleview-selectorhighlighter:active
,
921 .ruleview-selectorhighlighter.highlighted {
922 fill: var
(--theme-icon-checked-color
);
923 /* Since the icon is quite thin, it can be hard to differentiate it
924 from its regular state. Adding some background helps make it pop a bit */
925 background-color: var
(--dimmed-highlighter-box-content-color
);
928 #ruleview-add-rule-button::before
{
929 background-image: url
("chrome://devtools/skin/images/add.svg");
930 background-size: 14px;
933 #pseudo-class-panel-toggle::before
{
937 #class-panel-toggle::before
{
941 #pseudo-class-panel-toggle::before
,
942 #class-panel-toggle::before
{
945 justify-content: center
;
950 #print-simulation-toggle::before
{
951 background-image: url
("chrome://devtools/skin/images/rules-view-print-simulation.svg");
954 #color-scheme-simulation-light-toggle::before
{
955 background-image: url
("chrome://devtools/skin/images/rules-view-light-mode-simulation.svg");
956 -moz-context-properties: fill
, stroke
;
957 stroke: currentColor
;
960 #color-scheme-simulation-dark-toggle::before
{
961 background-image: url
("chrome://devtools/skin/images/rules-view-dark-mode-simulation.svg");
965 transition: background
1s;
968 .ruleview-propertyvalue-draggable {
972 .ruleview-propertyvalue-dragging {
976 .ruleview-propertyvalue-break-spaces {
977 white-space: break-spaces
;