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
,
204 .ruleview-expandable-container
,
205 .ruleview-overridden-items
,
206 .ruleview-overridden-rule-filter
,
208 .ruleview-unused-warning
,
209 .ruleview-compatibility-warning
,
211 .ruleview-invalid-at-computed-value-time-warning
,
213 .ruleview-overridden .ruleview-grid {
217 .ruleview-computedlist
[user-open
],
218 .ruleview-computedlist
[filter-open
],
219 .ruleview-overridden-items {
223 .ruleview-rule-source {
228 /* Force RTL direction to crop the source link at the beginning. */
231 text-overflow: ellipsis
;
237 /* Because of the overflow hidden, the outline that would be set on the child link
238 would not be visible, so we need to set it here */
239 &:focus-within:has
(a:focus-visible
) {
240 outline: var
(--theme-focus-outline
);
244 .ruleview-rule-source-label {
249 /* Create an LTR embed to avoid special characters being shifted to the start due to the
250 parent node direction: rtl; */
254 /* We don't always have a link (e.g. for inline style, it's a simple span), and in such
255 case, we shouldn't set the color the same as link color */
257 color: var
(--theme-internal-link-color
);
259 /* The outline is set on ruleview-rule-source */
265 color: var
(--theme-internal-link-color
);
270 .ruleview-rule-source
.disabled
> .ruleview-rule-source-label
,
271 .ruleview-rule-source[unselectable] > .ruleview-rule-source-label {
275 .ruleview-rule-source:not([unselectable]) {
276 text-decoration: underline
;
277 text-decoration-skip-ink: none
;
281 --ruleview-header-padding: 4px;
282 background: var
(--rule-header-background-color
);
283 border-bottom: 1px solid var
(--theme-splitter-color
);
284 color: var
(--theme-toolbar-color
);
287 padding: var
(--ruleview-header-padding
);
294 .ruleview-expandable-header {
296 /* Reset padding set on ruleview-header since we're going to put it on the button instead */
300 background-color: var
(--theme-accordion-header-hover
);
303 & button
[aria-expanded
] {
305 /* Space between arrow and label */
308 padding: var
(--ruleview-header-padding
);
309 /* Reset button-specific styles */
310 background-color: transparent
;
313 /* Apply same font-size as set on ruleview-header */
315 outline-offset: -2px;
317 &[aria-expanded
="true"] .theme-twisty
{
323 .ruleview-rule-pseudo-element {
325 border-left: solid
10px;
329 border-bottom: 1px solid var
(--theme-splitter-color
);
334 #ruleview-container-focusable > .ruleview-rule:last-child
{
339 * Display rules that don't match the current selected element and uneditable
340 * user agent styles differently
342 .ruleview-rule
.unmatched
,
343 .ruleview-rule
.uneditable
,
344 .ruleview-rule
[unmatched
=true
],
345 .ruleview-rule[uneditable=true] {
346 background: var
(--theme-tab-toolbar-background
);
349 .ruleview-rule
.unmatched
,
350 .ruleview-rule[unmatched=true] {
354 .ruleview-rule
.uneditable :focus
,
355 .ruleview-rule[uneditable=true] :focus {
359 .ruleview-rule
.uneditable
.theme-link
,
360 .ruleview-rule[uneditable=true] .theme-link {
361 color: var
(--theme-highlight-bluegrey
);
364 .ruleview-rule
.uneditable
.ruleview-enableproperty
,
365 .ruleview-rule[uneditable=true] .ruleview-enableproperty {
369 .ruleview-rule
.uneditable
.ruleview-swatch
,
370 .ruleview-rule[uneditable=true] .ruleview-swatch {
374 .ruleview-rule
.uneditable
.ruleview-namecontainer
> .ruleview-propertyname
,
375 .ruleview-rule
.uneditable
.ruleview-propertyvaluecontainer
>
376 .ruleview-propertyvalue
,
377 .ruleview-rule
[uneditable
=true
] .ruleview-namecontainer
> .ruleview-propertyname
,
378 .ruleview-rule
[uneditable
=true
] .ruleview-propertyvaluecontainer
>
379 .ruleview-propertyvalue {
380 border-bottom-color: transparent
;
383 .ruleview-overridden-rule-filter {
384 display: inline-block
;
387 margin-inline-start: 3px;
388 background-image: url
(chrome://devtools
/skin
/images
/filter-small
.svg
);
389 background-position: center
;
390 background-repeat: no-repeat
;
391 background-size: 12px;
392 -moz-context-properties: fill
;
393 fill: var
(--theme-icon-dimmed-color
);
394 background-color: transparent
;
397 &:is
(:hover
, :focus-visible
) {
398 fill: var
(--theme-icon-color
);
403 padding-inline-end: 5px;
406 .ruleview-ruleclose {
412 .ruleview-ancestor-ruleopen
,
413 .ruleview-ancestor-ruleclose {
414 color: var
(--theme-comment
);
417 .ruleview-rule-indent, .ruleview-ancestor-ruleclose {
420 * We do want to keep the underlying chars for the indent for user to copy/paste,
421 * but we can reduce the inline space it takes.
422 * Tweaking word-spacing instead of using font-size as the latter could be odd when
423 * the text is selected.
424 * Avoid using letter-spacing as this can cause visual glitches on low-dpi screen (see Bug 1845517).
426 word-spacing: -0.5ch;
429 .ruleview-rule-indent.clipboard-only {
440 .ruleview-propertylist {
446 .ruleview-expandable-container.registered-properties .ruleview-propertylist {
447 /* Since we don't have a toggle checkbox for registered property definitions, we set
448 a padding so they have the same indent as properties in regular rules */
449 padding-inline-start: 28px;
452 .ruleview-enableproperty {
458 .ruleview-enableproperty {
459 box-sizing: border-box
;
460 margin-inline-start: var
(--rule-enableproperty-margin-inline-start
);
461 margin-inline-end: var
(--rule-enableproperty-margin-inline-end
);
462 width: var
(--rule-enableproperty-size
);
463 height: var
(--rule-enableproperty-size
);
465 /* The SVG checkbox on Windows and Linux */
466 :root:is
([platform
="win"], [platform
="linux"]) & {
469 box-sizing: content-box
;
470 display: inline-block
;
473 background: url
("chrome://devtools/skin/images/checkbox.svg") center no-repeat content-box
;
474 /* Using fill to paint the border, and stroke for the tick */
475 -moz-context-properties: fill
, stroke
;
476 fill: rgba
(0,0,0,.3);
480 :root
[platform
="mac"] & {
482 -moz-default-appearance: checkbox
;
486 :root
[platform
="win"].theme-dark
.ruleview-enableproperty
,
487 :root
[platform
="linux"].theme-dark
.ruleview-enableproperty
{
488 fill: rgba
(255,255,255,.4);
491 :root
[platform
="win"] .ruleview-enableproperty:checked
,
492 :root
[platform
="linux"] .ruleview-enableproperty:checked
{
493 stroke: rgba
(0,0,0,.6);
496 :root
[platform
="win"].theme-dark
.ruleview-enableproperty:checked
,
497 :root
[platform
="linux"].theme-dark
.ruleview-enableproperty:checked
{
498 stroke: rgba
(255,255,255,.8);
502 .ruleview-unused-warning
,
503 .ruleview-compatibility-warning
,
504 .ruleview-invalid-at-computed-value-time-warning {
505 display: inline-block
;
508 background-size: 12px;
509 background-repeat: no-repeat
;
510 -moz-context-properties: fill
;
514 background-image: url
(resource://devtools-shared-images
/alert-small
.svg
);
515 fill: var
(--yellow-60
);
518 .ruleview-invalid-at-computed-value-time-warning {
519 background-image: var
(--invalid-at-computed-value-time-icon
);
520 fill: var
(--invalid-at-computed-value-time-fill-color
);
524 .ruleview-unused-warning {
525 background-image: url
(resource://devtools-shared-images
/info-small
.svg
);
526 background-color: var
(--theme-sidebar-background
);
527 fill: var
(--theme-icon-dimmed-color
);
530 .ruleview-compatibility-warning {
531 background-image: url
(chrome://devtools
/skin
/images
/report
.svg
);
532 background-color: var
(--theme-sidebar-background
);
533 fill: var
(--theme-icon-dimmed-color
);
536 .ruleview-unused-warning:hover
,
537 .ruleview-compatibility-warning:hover {
538 fill: var
(--theme-icon-color
);
539 stroke: var
(--theme-icon-color
);
542 .ruleview-rule:not(:hover, :focus-within) .ruleview-enableproperty {
543 /* Use opacity to hide the checkbox instead of visibility:hidden,
544 so that it's possible to focus it with the keyboard. */
549 vertical-align: middle
;
552 .ruleview-propertycontainer .ruleview-expander {
556 .ruleview-propertycontainer .ruleview-expander:dir(rtl):not([open]) {
557 /* for preventing .theme-twisty's wrong direction in rtl; Bug 1296648 */
558 transform: rotate
(-90deg);
561 .ruleview-newproperty {
562 /* As we don't have the checkbox displayed before the input, we need to align it
563 with the property name above it. */
564 margin-inline-start: calc
(
565 var
(--rule-enableproperty-size
) +
566 var
(--rule-enableproperty-margin-inline-start
) +
567 var
(--rule-enableproperty-margin-inline-end
)
571 .ruleview-namecontainer
,
572 .ruleview-propertyvaluecontainer
,
573 .ruleview-propertyname
,
574 .ruleview-propertyvalue {
575 text-decoration: inherit
;
578 .ruleview-computedlist {
583 .ruleview-overridden-items {
589 .ruleview-overridden-item {
593 .ruleview-overridden-item::before
,
594 .ruleview-overridden-item::after {
598 border: 0 solid var
(--theme-text-color-alt
);
601 .ruleview-overridden-item::before {
606 border-left-width: 0.5px;
607 border-bottom-width: 0.5px;
610 .ruleview-overridden-item::after {
614 border-left-width: 0.5px;
617 .ruleview-overridden-item:last-child::after {
621 .ruleview-overridden-item .ruleview-namecontainer {
629 .ruleview-shapeswatch
,
634 vertical-align: middle
;
636 /* align the swatch with its value */
638 margin-inline-end: 5px;
639 display: inline-block
;
643 /* Icon swatches not using the .ruleview-swatch class (flex, grid, shape) */
647 .ruleview-shapeswatch {
648 background-color: transparent
;
650 -moz-context-properties: stroke
;
651 stroke: var
(--theme-icon-color
);
652 /* Prevent line break when copy/pasting an entire rule */
659 .ruleview-shapeswatch
660 )[aria-pressed
="true"] {
661 stroke: var
(--theme-icon-checked-color
);
665 background-image: url
("chrome://devtools/skin/images/flexbox-swatch.svg");
666 background-size: 13px 11px;
672 background-image: url
("chrome://devtools/skin/images/grid.svg");
675 .ruleview-grid[disabled] {
680 .ruleview-shapeswatch {
681 background-image: url
("chrome://devtools/skin/images/shape-swatch.svg");
682 background-size: 110%;
687 .ruleview-shape-point
.active
,
688 .ruleview-shapeswatch.active + .ruleview-shape > .ruleview-shape-point:hover {
689 background-color: var
(--rule-highlight-background-color
);
692 /* Round swatches using the .ruleview-swatch class (color, bezier, filter and angle) */
695 background-size: 1em;
699 .ruleview-colorswatch::before {
701 background-color: #eee;
702 background-image: linear-gradient
(45deg, #ccc 25%, transparent
25%, transparent
75%, #ccc 75%, #ccc),
703 linear-gradient
(45deg, #ccc 25%, transparent
25%, transparent
75%, #ccc 75%, #ccc);
704 background-size: 12px 12px;
705 background-position: 0 0, 6px 6px;
715 .ruleview-swatch.ruleview-colorswatch {
718 /* Adjust outline so it doesn't conflate with the color swatch, which could have a similar background
719 color as the outline */
721 /* Make sure that the background color is properly set in High Contrast Mode */
722 forced-color-adjust: none
;
725 .ruleview-bezierswatch {
726 background-image: url
("chrome://devtools/skin/images/cubic-bezier-swatch.svg");
729 .ruleview-filterswatch {
730 background-image: url
("chrome://devtools/skin/images/filter-swatch.svg");
733 .ruleview-angleswatch {
734 background-image: url
("chrome://devtools/skin/images/angle-swatch.svg");
737 .ruleview-lineareasingswatch {
738 background-image: url
("chrome://devtools/skin/images/linear-easing-swatch.svg");
741 .ruleview-overridden {
742 text-decoration: line-through solid var
(--theme-text-color-alt
);
746 * Hide swatches (tool icons) from properties that are overwritten by higher specificity * rules.
747 * .ruleview-swatch is a base class for many tool swatches (shapes, color, bezier curves)
748 * .ruleview-flex and .ruleview-grid are custom
750 .ruleview-overridden
.ruleview-flex
,
751 .ruleview-overridden
.ruleview-grid
,
752 .ruleview-overridden
.ruleview-shapeswatch
,
753 .ruleview-overridden .ruleview-swatch {
757 .ruleview-font-family.used-font {
758 text-decoration: underline
;
761 .styleinspector-propertyeditor {
767 /* Unset the outline box shadow to prevent overlapping previous/next properties.
768 This is safe since those input won't be this part of the UI won't get */
769 --theme-outline-box-shadow: initial
;
774 border-left: 3px solid transparent
;
776 overflow-wrap: break-word
;
777 /* When the text of the property wraps, we want the wrapping lines to have an indent so
778 they don't go under the checkbox */
779 text-indent: var
(--rule-computed-margin-inline-start
) hanging
;
782 .ruleview-propertycontainer > * {
783 vertical-align: middle
;
786 .ruleview-property
.ruleview-changed
,
787 .ruleview-property[dirty] {
788 border-left-color: var
(--theme-highlight-green
);
791 .ruleview-highlight {
793 * If we'd rely solely on background color change for highlighted element, we would need
794 * to pick a color that would bring at least 3:1 ratio (see 1.4.11 Non-text Contrast).
795 * As this would be too disturbing for the user, we need to indicate impacted element
796 * with another graphical mean.
797 * So here we'll use a bottom box-shadow (not a border to avoid impacting the layout)
798 * which will match the style we have in Debugger for search results.
800 background-color: var
(--rule-highlight-background-color
);
801 /* Put the box-shadow inside the element so it's still visible when sibling elements are highlighted */
802 box-shadow: inset
0px -1px 0px 0px var
(--theme-contrast-border
);
805 /* property name and value and unmatched/inactive colors need to be adjusted
806 in order to have enough contrast against the highlighted background */
807 & .ruleview-propertyname
{
808 color: var
(--rule-highlight-propertyname
);
811 & .ruleview-propertyvalue
{
812 color: var
(--rule-highlight-propertyvalue
);
815 &.ruleview-selector
.unmatched
,
816 & .ruleview-unmatched
,
817 .ruleview-property:is(.unused, .ruleview-overridden) & :is(.ruleview-propertyname, .ruleview-propertyvalue) {
818 color: var
(--rule-highlight-unmatched-unused-color
);
822 .ruleview-namecontainer
> .ruleview-propertyname
,
823 .ruleview-propertyvaluecontainer > .ruleview-propertyvalue {
824 border-bottom: 1px dashed transparent
;
827 .ruleview-namecontainer:hover
> .ruleview-propertyname
,
828 .ruleview-propertyvaluecontainer:hover > .ruleview-propertyvalue {
829 border-bottom-color: hsl
(0,0%,50%);
832 /* ancestor rules info element (parent at-rules, parent of nested rules, …) */
833 .ruleview-rule-ancestor-data {
835 display: inline-block
;
841 .ruleview-rule-ancestor-data [role="listitem"] {
842 /* When there's a search and this element is highlighted, this prevents the background
843 color to be applied to the whole width of the parent ul block */
844 max-width: max-content
;
847 .ruleview-rule-ancestor-data [role="listitem"].has-tooltip:hover .container-query-declaration {
848 text-decoration: underline
;
849 text-decoration-color: var
(--theme-highlight-blue
);
850 text-decoration-style: dotted
;
851 text-decoration-skip-ink: none
;
852 text-decoration-thickness: 2px;
853 text-underline-offset: 2px;
856 .ruleview-rule-ancestor-data [role="listitem"] :is(button,[role="button"]).open-inspector {
857 /* There's a space character after the button, so add a 1ch margin-inline-start to be consistent */
858 margin-inline: 1ch 0;
862 .ruleview-selectors-container
,
863 .ruleview-registered-property-name {
864 word-wrap: break-word
;
869 color: var
(--theme-highlight-blue
);
872 .ruleview-selector-separator
,
873 .ruleview-selector
.unmatched
,
875 .ruleview-property:is(.unused, .ruleview-overridden) :is(.ruleview-propertyname,.ruleview-propertyvalue) {
876 color: var
(--theme-text-color-alt
);
879 /* We use a dimmer color for those unmatching element, but we can't convey state change
880 only with colors, so let's add a line-through line */
882 .ruleview-selector
.unmatched
,
884 .ruleview-invalid-at-computed-value-time
886 /* don't show the strike through when the element is hovered so it's more legible */
889 text-decoration: line-through solid currentColor
;
892 .ruleview-selector.matched > .ruleview-selector-attribute {
893 /* TODO: Bug 1178535 Awaiting UX feedback on highlight colors */
896 .ruleview-selector.matched > .ruleview-selector-pseudo-class {
897 /* TODO: Bug 1178535 Awaiting UX feedback on highlight colors */
900 .ruleview-selector.matched > .ruleview-selector-pseudo-class-lock {
901 color: var
(--pseudo-class-text-color
);
904 .ruleview-selector-warnings {
905 display: inline-block
;
908 margin-inline-start: 2px;
909 vertical-align: text-top
;
912 border: 1px solid var
(--theme-warning-border
);
913 background-color: var
(--theme-warning-background
);
914 background-repeat: no-repeat
;
915 background-position: center
;
916 fill: var
(--theme-warning-color
);
917 -moz-context-properties: fill
;
919 /* Default warning icon */
920 background-image: url
(resource://devtools-shared-images
/alert-small
.svg
);
921 background-size: 10px;
924 background-image: url
(chrome://devtools
/content
/netmonitor
/src
/assets
/icons
/turtle
.svg
);
925 background-size: 12px;
929 /* When hovering the selector warnings icon, highlight the selector it applies to */
930 .ruleview-selector:has(.ruleview-selector-warnings:hover) {
931 background-color: var
(--theme-warning-background
);
932 /* We're not using --theme-warning-border to make it more visible */
933 outline: 1px solid var
(--theme-warning-color
);
935 & .ruleview-selector-warnings
{
936 /* In such case, hide the icon border to make it cleaner */
937 border-color: transparent
;
941 .ruleview-selectorhighlighter {
942 display: inline-block
;
948 background: url
("chrome://devtools/skin/images/highlight-selector.svg") no-repeat
0 0;
949 background-size: contain
;
951 -moz-context-properties: fill
;
952 fill: var
(--theme-icon-dimmed-color
);
953 /* Prevent line break when copy/pasting an entire rule */
957 .ruleview-selectorhighlighter:hover {
958 fill: var
(--theme-icon-color
);
961 .ruleview-selectorhighlighter:active
,
962 .ruleview-selectorhighlighter.highlighted {
963 fill: var
(--theme-icon-checked-color
);
964 /* Since the icon is quite thin, it can be hard to differentiate it
965 from its regular state. Adding some background helps make it pop a bit */
966 background-color: var
(--dimmed-highlighter-box-content-color
);
969 #ruleview-add-rule-button::before
{
970 background-image: url
("chrome://devtools/skin/images/add.svg");
971 background-size: 14px;
974 #pseudo-class-panel-toggle::before
{
978 #class-panel-toggle::before
{
982 #pseudo-class-panel-toggle::before
,
983 #class-panel-toggle::before
{
986 justify-content: center
;
991 #print-simulation-toggle::before
{
992 background-image: url
("chrome://devtools/skin/images/rules-view-print-simulation.svg");
995 #color-scheme-simulation-light-toggle::before
{
996 background-image: url
("chrome://devtools/skin/images/rules-view-light-mode-simulation.svg");
997 -moz-context-properties: fill
, stroke
;
998 stroke: currentColor
;
1001 #color-scheme-simulation-dark-toggle::before
{
1002 background-image: url
("chrome://devtools/skin/images/rules-view-dark-mode-simulation.svg");
1006 transition: background
1s;
1009 .ruleview-propertyvalue-draggable {
1013 .ruleview-propertyvalue-dragging {
1017 .ruleview-propertyvalue-break-spaces {
1018 white-space: break-spaces
;