/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /* Naming convention: If a variable is used for a specific component: --{component}-{property name}-{modifier} Both {component} and {property name} should be kebab-case. If the target is the entire page, use 'report' for the component. The property name should not be abbreviated. Use the property name the variable is intended for - if it's used for multiple, a common descriptor is fine (ex: 'size' for a variable applied to 'width' and 'height'). If a variable is shared across multiple components, either create more variables or just drop the "{component}-" part of the name. Append any modifiers at the end (ex: 'big', 'dark'). For colors: --color-{hue}-{intensity} {intensity} is the Material Design tag - 700, A700, etc. */ .lh-vars { /* Palette using Material Design Colors * https://www.materialui.co/colors */ --color-amber-50: #FFF8E1; --color-blue-200: #90CAF9; --color-blue-900: #0D47A1; --color-blue-A700: #2962FF; --color-blue-primary: #06f; --color-cyan-500: #00BCD4; --color-gray-100: #F5F5F5; --color-gray-300: #CFCFCF; --color-gray-200: #E0E0E0; --color-gray-400: #BDBDBD; --color-gray-50: #FAFAFA; --color-gray-500: #9E9E9E; --color-gray-600: #757575; --color-gray-700: #616161; --color-gray-800: #424242; --color-gray-900: #212121; --color-gray: #000000; --color-green-700: #080; --color-green: #0c6; --color-lime-400: #D3E156; --color-orange-50: #FFF3E0; --color-orange-700: #C33300; --color-orange: #fa3; --color-red-700: #c00; --color-red: #f33; --color-teal-600: #00897B; --color-white: #FFFFFF; /* Context-specific colors */ --color-average-secondary: var(--color-orange-700); --color-average: var(--color-orange); --color-fail-secondary: var(--color-red-700); --color-fail: var(--color-red); --color-hover: var(--color-gray-50); --color-informative: var(--color-blue-900); --color-pass-secondary: var(--color-green-700); --color-pass: var(--color-green); --color-not-applicable: var(--color-gray-600); /* Component variables */ --audit-description-padding-left: calc(var(--score-icon-size) + var(--score-icon-margin-left) + var(--score-icon-margin-right)); --audit-explanation-line-height: 16px; --audit-group-margin-bottom: calc(var(--default-padding) * 6); --audit-group-padding-vertical: 8px; --audit-margin-horizontal: 5px; --audit-padding-vertical: 8px; --category-padding: calc(var(--default-padding) * 6) var(--edge-gap-padding) calc(var(--default-padding) * 4); --chevron-line-stroke: var(--color-gray-600); --chevron-size: 12px; --default-padding: 8px; --edge-gap-padding: calc(var(--default-padding) * 4); --env-item-background-color: var(--color-gray-100); --env-item-font-size: 28px; --env-item-line-height: 36px; --env-item-padding: 10px 0px; --env-name-min-width: 220px; --footer-padding-vertical: 16px; --gauge-circle-size-big: 96px; --gauge-circle-size: 48px; --gauge-circle-size-sm: 32px; --gauge-label-font-size-big: 18px; --gauge-label-font-size: var(--report-font-size-secondary); --gauge-label-line-height-big: 24px; --gauge-label-line-height: var(--report-line-height-secondary); --gauge-percentage-font-size-big: 38px; --gauge-percentage-font-size: var(--report-font-size-secondary); --gauge-wrapper-width: 120px; --header-line-height: 24px; --highlighter-background-color: var(--report-text-color); --icon-square-size: calc(var(--score-icon-size) * 0.88); --image-preview-size: 48px; --link-color: var(--color-blue-primary); --locale-selector-background-color: var(--color-white); --metric-toggle-lines-fill: #7F7F7F; --metric-value-font-size: calc(var(--report-font-size) * 1.8); --metrics-toggle-background-color: var(--color-gray-200); --plugin-badge-background-color: var(--color-white); --plugin-badge-size-big: calc(var(--gauge-circle-size-big) / 2.7); --plugin-badge-size: calc(var(--gauge-circle-size) / 2.7); --plugin-icon-size: 65%; --report-background-color: #fff; --report-border-color-secondary: #ebebeb; --report-font-family-monospace: monospace, 'Roboto Mono', 'Menlo', 'dejavu sans mono', 'Consolas', 'Lucida Console'; --report-font-family: system-ui, Roboto, Helvetica, Arial, sans-serif; --report-font-size: 14px; --report-font-size-secondary: 12px; --report-icon-size: var(--score-icon-background-size); --report-line-height: 24px; --report-line-height-secondary: 20px; --report-monospace-font-size: calc(var(--report-font-size) * 0.85); --report-text-color-secondary: var(--color-gray-800); --report-text-color: var(--color-gray-900); --report-content-max-width: calc(60 * var(--report-font-size)); /* defaults to 840px */ --report-content-min-width: 360px; --report-content-max-width-minus-edge-gap: calc(var(--report-content-max-width) - var(--edge-gap-padding) * 2); --score-container-padding: 8px; --score-icon-background-size: 24px; --score-icon-margin-left: 6px; --score-icon-margin-right: 14px; --score-icon-margin: 0 var(--score-icon-margin-right) 0 var(--score-icon-margin-left); --score-icon-size: 12px; --score-icon-size-big: 16px; --screenshot-overlay-background: rgba(0, 0, 0, 0.3); --section-padding-vertical: calc(var(--default-padding) * 6); --snippet-background-color: var(--color-gray-50); --snippet-color: #0938C2; --stackpack-padding-horizontal: 10px; --sticky-header-background-color: var(--report-background-color); --sticky-header-buffer: var(--topbar-height); --sticky-header-height: calc(var(--gauge-circle-size-sm) + var(--score-container-padding) * 2 + 1em); --table-group-header-background-color: #EEF1F4; --table-group-header-text-color: var(--color-gray-700); --table-higlight-background-color: #F5F7FA; --tools-icon-color: var(--color-gray-600); --topbar-background-color: var(--color-white); --topbar-height: 32px; --topbar-logo-size: 24px; --topbar-padding: 0 8px; --toplevel-warning-background-color: hsla(30, 100%, 75%, 10%); --toplevel-warning-message-text-color: var(--color-average-secondary); --toplevel-warning-padding: 18px; --toplevel-warning-text-color: var(--report-text-color); /* SVGs */ --plugin-icon-url-dark: url('data:image/svg+xml;utf8,'); --plugin-icon-url: url('data:image/svg+xml;utf8,'); --pass-icon-url: url('data:image/svg+xml;utf8,'); --average-icon-url: url('data:image/svg+xml;utf8,'); --fail-icon-url: url('data:image/svg+xml;utf8,'); --error-icon-url: url('data:image/svg+xml;utf8,'); --swap-locale-icon-url: url('data:image/svg+xml;utf8,'); --insights-icon-url: url('data:image/svg+xml;utf8,'); --insights-icon-url-dark: url('data:image/svg+xml;utf8,'); } @media not print { .lh-dark { /* Pallete */ --color-gray-200: var(--color-gray-800); --color-gray-300: #616161; --color-gray-400: var(--color-gray-600); --color-gray-700: var(--color-gray-400); --color-gray-50: #757575; --color-gray-600: var(--color-gray-500); --color-green-700: var(--color-green); --color-orange-700: var(--color-orange); --color-red-700: var(--color-red); --color-teal-600: var(--color-cyan-500); /* Context-specific colors */ --color-hover: rgba(0, 0, 0, 0.2); --color-informative: var(--color-blue-200); /* Component variables */ --env-item-background-color: #393535; --link-color: var(--color-blue-200); --locale-selector-background-color: var(--color-gray-200); --plugin-badge-background-color: var(--color-gray-800); --report-background-color: var(--color-gray-900); --report-border-color-secondary: var(--color-gray-200); --report-text-color-secondary: var(--color-gray-400); --report-text-color: var(--color-gray-100); --snippet-color: var(--color-cyan-500); --topbar-background-color: var(--color-gray); --toplevel-warning-background-color: hsl(33deg 14% 18%); --toplevel-warning-message-text-color: var(--color-orange-700); --toplevel-warning-text-color: var(--color-gray-100); --table-group-header-background-color: rgba(186, 196, 206, 0.15); --table-group-header-text-color: var(--color-gray-100); --table-higlight-background-color: rgba(186, 196, 206, 0.09); /* SVGs */ --plugin-icon-url: var(--plugin-icon-url-dark); } } /** * This media query is a temporary fallback for browsers that do not support `@container query`. * TODO: remove this media query when `@container query` is fully supported by browsers * See https://github.com/GoogleChrome/lighthouse/pull/16332 */ @media only screen and (max-width: 480px) { .lh-vars { --audit-group-margin-bottom: 20px; --edge-gap-padding: var(--default-padding); --env-name-min-width: 120px; --gauge-circle-size-big: 96px; --gauge-circle-size: 72px; --gauge-label-font-size-big: 22px; --gauge-label-font-size: 14px; --gauge-label-line-height-big: 26px; --gauge-label-line-height: 20px; --gauge-percentage-font-size-big: 34px; --gauge-percentage-font-size: 26px; --gauge-wrapper-width: 112px; --header-padding: 16px 0 16px 0; --image-preview-size: 24px; --plugin-icon-size: 75%; --report-font-size: 14px; --report-line-height: 20px; --score-icon-margin-left: 2px; --score-icon-size: 10px; --topbar-height: 28px; --topbar-logo-size: 20px; } } @container lh-container (max-width: 480px) { .lh-vars { --audit-group-margin-bottom: 20px; --edge-gap-padding: var(--default-padding); --env-name-min-width: 120px; --gauge-circle-size-big: 96px; --gauge-circle-size: 72px; --gauge-label-font-size-big: 22px; --gauge-label-font-size: 14px; --gauge-label-line-height-big: 26px; --gauge-label-line-height: 20px; --gauge-percentage-font-size-big: 34px; --gauge-percentage-font-size: 26px; --gauge-wrapper-width: 112px; --header-padding: 16px 0 16px 0; --image-preview-size: 24px; --plugin-icon-size: 75%; --report-font-size: 14px; --report-line-height: 20px; --score-icon-margin-left: 2px; --score-icon-size: 10px; --topbar-height: 28px; --topbar-logo-size: 20px; } } .lh-vars.lh-devtools { --audit-explanation-line-height: 14px; --audit-group-margin-bottom: 20px; --audit-group-padding-vertical: 12px; --audit-padding-vertical: 4px; --category-padding: 12px; --default-padding: 12px; --env-name-min-width: 120px; --footer-padding-vertical: 8px; --gauge-circle-size-big: 72px; --gauge-circle-size: 64px; --gauge-label-font-size-big: 22px; --gauge-label-font-size: 14px; --gauge-label-line-height-big: 26px; --gauge-label-line-height: 20px; --gauge-percentage-font-size-big: 34px; --gauge-percentage-font-size: 26px; --gauge-wrapper-width: 97px; --header-line-height: 20px; --header-padding: 16px 0 16px 0; --screenshot-overlay-background: transparent; --plugin-icon-size: 75%; --report-font-size: 12px; --report-line-height: 20px; --score-icon-margin-left: 2px; --score-icon-size: 10px; --section-padding-vertical: 8px; } .lh-container:has(.lh-sticky-header) { --sticky-header-buffer: calc(var(--topbar-height) + var(--sticky-header-height)); } .lh-container:not(.lh-topbar + .lh-container) { --topbar-height: 0; --sticky-header-height: 0; --sticky-header-buffer: 0; } .lh-max-viewport { display: flex; flex-direction: column; min-height: 100vh; width: 100%; } .lh-devtools.lh-root { height: 100%; } .lh-devtools.lh-root img { /* Override devtools default 'min-width: 0' so svg without size in a flexbox isn't collapsed. */ min-width: auto; } .lh-devtools .lh-container { overflow-y: scroll; height: calc(100% - var(--topbar-height)); /** The .lh-container is the scroll parent in DevTools so we exclude the topbar from the sticky header buffer. */ --sticky-header-buffer: 0; } .lh-devtools .lh-container:has(.lh-sticky-header) { /** The .lh-container is the scroll parent in DevTools so we exclude the topbar from the sticky header buffer. */ --sticky-header-buffer: var(--sticky-header-height); } @media print { .lh-devtools .lh-container { overflow: unset; } } .lh-devtools .lh-sticky-header { /* This is normally the height of the topbar, but we want it to stick to the top of our scroll container .lh-container` */ top: 0; } .lh-devtools .lh-element-screenshot__overlay { position: absolute; } @keyframes fadeIn { 0% { opacity: 0;} 100% { opacity: 0.6;} } .lh-root *, .lh-root *::before, .lh-root *::after { box-sizing: border-box; } .lh-root { font-family: var(--report-font-family); font-size: var(--report-font-size); margin: 0; line-height: var(--report-line-height); background: var(--report-background-color); color: var(--report-text-color); } .lh-root [hidden] { display: none !important; } .lh-root pre { margin: 0; } .lh-root pre, .lh-root code { font-family: var(--report-font-family-monospace); } .lh-root details > summary { cursor: pointer; } .lh-hidden { display: none !important; } .lh-container { /* Text wrapping in the report is so much FUN! We have a `word-break: break-word;` globally here to prevent a few common scenarios, namely long non-breakable text (usually URLs) found in: 1. The footer 2. .lh-node (outerHTML) 3. .lh-code With that sorted, the next challenge is appropriate column sizing and text wrapping inside our .lh-details tables. Even more fun. * We don't want table headers ("Est Savings (ms)") to wrap or their column values, but we'd be happy for the URL column to wrap if the URLs are particularly long. * We want the narrow columns to remain narrow, providing the most column width for URL * We don't want the table to extend past 100% width. * Long URLs in the URL column can wrap. Util.getURLDisplayName maxes them out at 64 characters, but they do not get any overflow:ellipsis treatment. */ word-break: break-word; container-name: lh-container; container-type: inline-size; } .lh-audit-group a, .lh-category-header__description a, .lh-audit__description a, .lh-warnings a, .lh-footer a, .lh-table-column--link a { color: var(--link-color); } .lh-audit__description, .lh-audit__stackpack, .lh-list-section__description { --inner-audit-padding-right: var(--stackpack-padding-horizontal); padding-left: var(--audit-description-padding-left); padding-right: var(--inner-audit-padding-right); padding-top: 8px; padding-bottom: 8px; } .lh-details { margin-top: var(--default-padding); margin-bottom: var(--default-padding); margin-left: var(--audit-description-padding-left); } .lh-audit__stackpack { display: flex; align-items: center; } .lh-audit__stackpack__img { max-width: 30px; margin-right: var(--default-padding) } /* Report header */ .lh-report-icon { display: flex; align-items: center; padding: 10px 12px; cursor: pointer; } .lh-report-icon[disabled] { opacity: 0.3; pointer-events: none; } .lh-report-icon::before { content: ""; margin: 4px; background-repeat: no-repeat; width: var(--report-icon-size); height: var(--report-icon-size); opacity: 0.7; display: inline-block; vertical-align: middle; } .lh-report-icon:hover::before { opacity: 1; } .lh-dark .lh-report-icon::before { filter: invert(1); } .lh-report-icon--print::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--copy::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--open::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--download::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--dark::before { background-image:url('data:image/svg+xml;utf8,'); } .lh-report-icon--treemap::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--date::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--devices::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--world::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--stopwatch::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--networkspeed::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--samples-one::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--samples-many::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--chrome::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--external::before { background-image: url('data:image/svg+xml;utf8,'); } .lh-report-icon--experiment::before { background-image: url('data:image/svg+xml;utf8,'); } /** These are still icons, but w/o the auto-color invert / opacity / etc. that come with .lh-report-icon */ .lh-report-plain-icon { display: flex; align-items: center; } .lh-report-plain-icon::before { content: ""; background-repeat: no-repeat; width: var(--report-icon-size); height: var(--report-icon-size); display: inline-block; margin-right: 5px; } .lh-report-plain-icon--checklist-pass::before { --icon-url: url('data:image/svg+xml;utf8,'); background-color: var(--color-pass); mask: var(--icon-url) center / contain no-repeat; } .lh-report-plain-icon--checklist-fail::before { --icon-url: url('data:image/svg+xml;utf8,'); background-color: var(--color-fail); mask: var(--icon-url) center / contain no-repeat; } .lh-buttons { display: flex; flex-wrap: wrap; margin: var(--default-padding) 0; } .lh-button { height: 32px; border: 1px solid var(--report-border-color-secondary); border-radius: 3px; color: var(--link-color); background-color: var(--report-background-color); margin: 5px; } .lh-button:first-of-type { margin-left: 0; } /* Node */ .lh-node { display: flow-root; } .lh-node__snippet { font-family: var(--report-font-family-monospace); color: var(--snippet-color); font-size: var(--report-monospace-font-size); line-height: 20px; } .lh-checklist { list-style: none; padding: 0; } .lh-checklist-item { margin: 10px 0 10px 0; } /* Score */ .lh-audit__score-icon { width: var(--score-icon-size); height: var(--score-icon-size); margin: var(--score-icon-margin); } .lh-audit--pass .lh-audit__display-text { color: var(--color-pass-secondary); } .lh-audit--pass .lh-audit__score-icon, .lh-scorescale-range--pass::before { border-radius: 100%; background: var(--color-pass); } .lh-audit--average .lh-audit__display-text { color: var(--color-average-secondary); } .lh-audit--average .lh-audit__score-icon, .lh-scorescale-range--average::before { background: var(--color-average); width: var(--icon-square-size); height: var(--icon-square-size); } .lh-audit--fail .lh-audit__display-text { color: var(--color-fail-secondary); } .lh-audit--fail .lh-audit__score-icon, .lh-audit--error .lh-audit__score-icon, .lh-scorescale-range--fail::before { border-left: calc(var(--score-icon-size) / 2) solid transparent; border-right: calc(var(--score-icon-size) / 2) solid transparent; border-bottom: var(--score-icon-size) solid var(--color-fail); } .lh-audit--error .lh-audit__score-icon, .lh-metric--error .lh-metric__icon { background-image: var(--error-icon-url); background-repeat: no-repeat; background-position: center; border: none; } .lh-gauge__wrapper--fail .lh-gauge--error { background-image: var(--error-icon-url); background-repeat: no-repeat; background-position: center; transform: scale(0.5); top: var(--score-container-padding); } .lh-audit--manual .lh-audit__display-text, .lh-audit--notapplicable .lh-audit__display-text { color: var(--color-gray-600); } .lh-audit--manual .lh-audit__score-icon, .lh-audit--notapplicable .lh-audit__score-icon { border: calc(0.2 * var(--score-icon-size)) solid var(--color-gray-400); border-radius: 100%; background: none; } .lh-audit--informative .lh-audit__display-text { color: var(--color-gray-600); } .lh-audit--informative .lh-audit__score-icon { border: calc(0.2 * var(--score-icon-size)) solid var(--color-gray-400); border-radius: 100%; } .lh-audit__description, .lh-audit__stackpack { color: var(--report-text-color-secondary); } .lh-audit__adorn { border: 1px solid var(--color-gray-500); border-radius: 3px; margin: 0 3px; padding: 0 2px; line-height: 1.1; display: inline-block; font-size: 90%; color: var(--report-text-color-secondary); } .lh-category-header__description { text-align: center; color: var(--color-gray-700); margin: 0px auto; max-width: 400px; } .lh-audit__display-text, .lh-chevron-container { margin: 0 var(--audit-margin-horizontal); } .lh-chevron-container { margin-right: 0; } .lh-audit__title-and-text { flex: 1; } .lh-audit__title-and-text code { color: var(--snippet-color); font-size: var(--report-monospace-font-size); } /* Prepend display text with em dash separator. */ .lh-audit__display-text:not(:empty):before { content: '—'; margin-right: var(--audit-margin-horizontal); } /* Expandable Details (Audit Groups, Audits) */ .lh-audit__header { display: flex; align-items: center; padding: var(--default-padding); } .lh-metricfilter { display: grid; justify-content: end; align-items: center; grid-auto-flow: column; gap: 4px; color: var(--color-gray-700); } .lh-metricfilter__radio { /* * Instead of hiding, position offscreen so it's still accessible to screen readers * https://bugs.chromium.org/p/chromium/issues/detail?id=1439785 */ position: fixed; left: -9999px; } .lh-metricfilter input[type='radio']:focus-visible + label { outline: -webkit-focus-ring-color auto 1px; } .lh-metricfilter__label { display: inline-flex; padding: 0 4px; height: 16px; text-decoration: underline; align-items: center; cursor: pointer; font-size: 90%; } .lh-metricfilter__label--active { background: var(--color-blue-primary); color: var(--color-white); border-radius: 3px; text-decoration: none; } /* Give the 'All' choice a more muted display */ .lh-metricfilter__label--active[for="metric-All"] { background-color: var(--color-blue-200) !important; color: black !important; } .lh-metricfilter__text { margin-right: 8px; } /* If audits are filtered, hide the itemcount for Passed Audits… */ .lh-category--filtered .lh-audit-group .lh-audit-group__itemcount { display: none; } .lh-audit__header:hover { background-color: var(--color-hover); } /* We want to hide the browser's default arrow marker on summary elements. Admittedly, it's complicated. */ .lh-root details > summary { /* Blink 89+ and Firefox will hide the arrow when display is changed from (new) default of `list-item` to block. https://chromestatus.com/feature/6730096436051968*/ display: block; } /* Safari and Blink <=88 require using the -webkit-details-marker selector */ .lh-root details > summary::-webkit-details-marker { display: none; } /* Perf Metric */ .lh-metrics-container { display: grid; grid-auto-rows: 1fr; grid-template-columns: 1fr 1fr; grid-column-gap: var(--report-line-height); margin-bottom: var(--default-padding); } .lh-metric { border-top: 1px solid var(--report-border-color-secondary); } .lh-category:not(.lh--hoisted-meta) .lh-metric:nth-last-child(-n+2) { border-bottom: 1px solid var(--report-border-color-secondary); } .lh-metric__innerwrap { display: grid; /** * Icon -- Metric Name * -- Metric Value */ grid-template-columns: calc(var(--score-icon-size) + var(--score-icon-margin-left) + var(--score-icon-margin-right)) 1fr; align-items: center; padding: var(--default-padding); } .lh-metric__details { order: -1; } .lh-metric__title { flex: 1; } .lh-calclink { padding-left: calc(1ex / 3); } .lh-metric__description { display: none; grid-column-start: 2; grid-column-end: 4; color: var(--report-text-color-secondary); } .lh-metric__value { font-size: var(--metric-value-font-size); margin: calc(var(--default-padding) / 2) 0; white-space: nowrap; /* No wrapping between metric value and the icon */ grid-column-start: 2; } /** * This media query is a temporary fallback for browsers that do not support `@container query`. * TODO: remove this media query when `@container query` is fully supported by browsers * See https://github.com/GoogleChrome/lighthouse/pull/16332 */ @media screen and (max-width: 535px) { .lh-metrics-container { display: block; } .lh-metric { border-bottom: none !important; } .lh-category:not(.lh--hoisted-meta) .lh-metric:nth-last-child(1) { border-bottom: 1px solid var(--report-border-color-secondary) !important; } /* Change the grid to 3 columns for narrow viewport. */ .lh-metric__innerwrap { /** * Icon -- Metric Name -- Metric Value */ grid-template-columns: calc(var(--score-icon-size) + var(--score-icon-margin-left) + var(--score-icon-margin-right)) 2fr 1fr; } .lh-metric__value { justify-self: end; grid-column-start: unset; } } @container lh-container (max-width: 535px) { .lh-metrics-container { display: block; } .lh-metric { border-bottom: none !important; } .lh-category:not(.lh--hoisted-meta) .lh-metric:nth-last-child(1) { border-bottom: 1px solid var(--report-border-color-secondary) !important; } /* Change the grid to 3 columns for narrow viewport. */ .lh-metric__innerwrap { /** * Icon -- Metric Name -- Metric Value */ grid-template-columns: calc(var(--score-icon-size) + var(--score-icon-margin-left) + var(--score-icon-margin-right)) 2fr 1fr; } .lh-metric__value { justify-self: end; grid-column-start: unset; } } /* No-JS toggle switch */ /* Keep this selector sync'd w/ `magicSelector` in report-ui-features-test.js */ .lh-metrics-toggle__input:checked ~ .lh-metrics-container .lh-metric__description { display: block; } /* TODO get rid of the SVGS and clean up these some more */ .lh-metrics-toggle__input { opacity: 0; position: absolute; right: 0; top: 0px; } .lh-metrics-toggle__input + div > label > .lh-metrics-toggle__labeltext--hide, .lh-metrics-toggle__input:checked + div > label > .lh-metrics-toggle__labeltext--show { display: none; } .lh-metrics-toggle__input:checked + div > label > .lh-metrics-toggle__labeltext--hide { display: inline; } .lh-metrics-toggle__input:focus + div > label { outline: -webkit-focus-ring-color auto 3px; } .lh-metrics-toggle__label { cursor: pointer; font-size: var(--report-font-size-secondary); line-height: var(--report-line-height-secondary); color: var(--color-gray-700); } /* Pushes the metric description toggle button to the right. */ .lh-audit-group--metrics .lh-audit-group__header { display: flex; justify-content: space-between; } .lh-metric__icon, .lh-scorescale-range::before { content: ''; width: var(--score-icon-size); height: var(--score-icon-size); display: inline-block; margin: var(--score-icon-margin); } .lh-metric--pass .lh-metric__value { color: var(--color-pass-secondary); } .lh-metric--pass .lh-metric__icon { border-radius: 100%; background: var(--color-pass); } .lh-metric--average .lh-metric__value { color: var(--color-average-secondary); } .lh-metric--average .lh-metric__icon { background: var(--color-average); width: var(--icon-square-size); height: var(--icon-square-size); } .lh-metric--fail .lh-metric__value { color: var(--color-fail-secondary); } .lh-metric--fail .lh-metric__icon { border-left: calc(var(--score-icon-size) / 2) solid transparent; border-right: calc(var(--score-icon-size) / 2) solid transparent; border-bottom: var(--score-icon-size) solid var(--color-fail); } .lh-metric--error .lh-metric__value, .lh-metric--error .lh-metric__description { color: var(--color-fail-secondary); } /* Filmstrip */ .lh-filmstrip-container { /* smaller gap between metrics and filmstrip */ margin: -8px auto 0 auto; } .lh-filmstrip { display: flex; justify-content: space-between; justify-items: center; margin-bottom: var(--default-padding); width: 100%; } .lh-filmstrip__frame { overflow: hidden; line-height: 0; } .lh-filmstrip__thumbnail { border: 1px solid var(--report-border-color-secondary); max-height: 150px; max-width: 120px; } /* Toggle Insights banner */ .lh-perf-insights-toggle { margin: calc(var(--default-padding) * 2) 0 var(--default-padding); display: flex; gap: var(--default-padding); align-items: center; background-color: rgba(30, 164, 70, 0.08); padding: var(--toplevel-warning-padding); border-radius: 8px; } .lh-perf-insights-toggle button { cursor: pointer; margin: 0; flex: 1; } .lh-perf-toggle-text { align-items: center; flex: 5; } .lh-dark .lh-perf-toggle-text { color: rgba(30, 164, 70, 1); } .lh-perf-toggle-text a { color: var(--link-color); } .lh-perf-insights-icon { margin: 4px; background-repeat: no-repeat; background-image: var(--insights-icon-url); width: var(--report-icon-size); height: var(--report-icon-size); display: inline-block; vertical-align: middle; } .lh-dark .lh-perf-insights-icon { background-image: var(--insights-icon-url-dark); } /* Audit */ .lh-audit { border-bottom: 1px solid var(--report-border-color-secondary); } /* Apply border-top to just the first audit. */ .lh-audit { border-top: 1px solid var(--report-border-color-secondary); } .lh-audit ~ .lh-audit { border-top: none; } .lh-audit--error .lh-audit__display-text { color: var(--color-fail-secondary); } /* Audit Group */ .lh-audit-group { margin-bottom: var(--audit-group-margin-bottom); position: relative; } .lh-audit-group--metrics { margin-bottom: calc(var(--audit-group-margin-bottom) / 2); } .lh-audit-group--metrics .lh-audit-group__summary { margin-top: 0; margin-bottom: 0; } .lh-audit-group__summary { display: flex; justify-content: space-between; align-items: center; } .lh-audit-group__header .lh-chevron { margin-top: calc((var(--report-line-height) - 5px) / 2); } .lh-audit-group__header { letter-spacing: 0.8px; padding: var(--default-padding); padding-left: 0; } .lh-audit-group__header, .lh-audit-group__summary { font-size: var(--report-font-size-secondary); line-height: var(--report-line-height-secondary); color: var(--color-gray-700); } .lh-audit-group__title { text-transform: uppercase; font-weight: 500; } .lh-audit-group__itemcount { color: var(--color-gray-600); } .lh-audit-group__footer { color: var(--color-gray-600); display: block; margin-top: var(--default-padding); } .lh-details, .lh-category-header__description, .lh-audit-group__footer { font-size: var(--report-font-size-secondary); line-height: var(--report-line-height-secondary); } .lh-audit-explanation { margin: var(--audit-padding-vertical) 0 calc(var(--audit-padding-vertical) / 2) var(--audit-margin-horizontal); line-height: var(--audit-explanation-line-height); display: inline-block; } .lh-audit--fail .lh-audit-explanation { color: var(--color-fail-secondary); } /* Report */ .lh-list { margin-right: calc(var(--default-padding) * 2); } .lh-list > :not(:last-child) { margin-bottom: calc(var(--default-padding) * 2); border-bottom: 1px solid #A8C7FA; } .lh-list-section { padding: calc(var(--default-padding) * 2) 0; } .lh-list-section__title { text-decoration: underline; } .lh-header-container { display: block; margin: 0 auto; position: relative; word-wrap: break-word; } .lh-header-container .lh-scores-wrapper { border-bottom: 1px solid var(--color-gray-200); } .lh-report { min-width: var(--report-content-min-width); } .lh-exception { font-size: large; } .lh-code { white-space: normal; margin-top: 0; font-size: var(--report-monospace-font-size); } .lh-warnings { --item-margin: calc(var(--report-line-height) / 6); color: var(--color-average-secondary); margin: var(--audit-padding-vertical) 0; padding: var(--default-padding) var(--default-padding) var(--default-padding) calc(var(--audit-description-padding-left)); background-color: var(--toplevel-warning-background-color); } .lh-warnings span { font-weight: bold; } .lh-warnings--toplevel { --item-margin: calc(var(--header-line-height) / 4); color: var(--toplevel-warning-text-color); margin-left: auto; margin-right: auto; max-width: var(--report-content-max-width-minus-edge-gap); padding: var(--toplevel-warning-padding); border-radius: 8px; } .lh-warnings__msg { color: var(--toplevel-warning-message-text-color); margin: 0; } .lh-warnings ul { margin: 0; } .lh-warnings li { margin: var(--item-margin) 0; } .lh-warnings li:last-of-type { margin-bottom: 0; } .lh-scores-header { display: flex; flex-wrap: wrap; justify-content: center; } .lh-scores-header__solo { padding: 0; border: 0; } /* Gauge */ .lh-gauge__wrapper--pass { color: var(--color-pass-secondary); fill: var(--color-pass); stroke: var(--color-pass); } .lh-gauge__wrapper--average { color: var(--color-average-secondary); fill: var(--color-average); stroke: var(--color-average); } .lh-gauge__wrapper--fail { color: var(--color-fail-secondary); fill: var(--color-fail); stroke: var(--color-fail); } .lh-gauge__wrapper--not-applicable { color: var(--color-not-applicable); fill: var(--color-not-applicable); stroke: var(--color-not-applicable); } .lh-fraction__wrapper .lh-fraction__content::before { content: ''; height: var(--score-icon-size); width: var(--score-icon-size); margin: var(--score-icon-margin); display: inline-block; } .lh-fraction__wrapper--pass .lh-fraction__content { color: var(--color-pass-secondary); } .lh-fraction__wrapper--pass .lh-fraction__background { background-color: var(--color-pass); } .lh-fraction__wrapper--pass .lh-fraction__content::before { background-color: var(--color-pass); border-radius: 50%; } .lh-fraction__wrapper--average .lh-fraction__content { color: var(--color-average-secondary); } .lh-fraction__wrapper--average .lh-fraction__background, .lh-fraction__wrapper--average .lh-fraction__content::before { background-color: var(--color-average); } .lh-fraction__wrapper--fail .lh-fraction__content { color: var(--color-fail); } .lh-fraction__wrapper--fail .lh-fraction__background { background-color: var(--color-fail); } .lh-fraction__wrapper--fail .lh-fraction__content::before { border-left: calc(var(--score-icon-size) / 2) solid transparent; border-right: calc(var(--score-icon-size) / 2) solid transparent; border-bottom: var(--score-icon-size) solid var(--color-fail); } .lh-fraction__wrapper--null .lh-fraction__content { color: var(--color-gray-700); } .lh-fraction__wrapper--null .lh-fraction__background { background-color: var(--color-gray-700); } .lh-fraction__wrapper--null .lh-fraction__content::before { border-radius: 50%; border: calc(0.2 * var(--score-icon-size)) solid var(--color-gray-700); } .lh-fraction__background { position: absolute; height: 100%; width: 100%; border-radius: calc(var(--gauge-circle-size) / 2); opacity: 0.1; z-index: -1; } .lh-fraction__content-wrapper { height: var(--gauge-circle-size); display: flex; align-items: center; } .lh-fraction__content { display: flex; position: relative; align-items: center; justify-content: center; font-size: calc(0.3 * var(--gauge-circle-size)); line-height: calc(0.4 * var(--gauge-circle-size)); width: max-content; min-width: calc(1.5 * var(--gauge-circle-size)); padding: calc(0.1 * var(--gauge-circle-size)) calc(0.2 * var(--gauge-circle-size)); --score-icon-size: calc(0.21 * var(--gauge-circle-size)); --score-icon-margin: 0 calc(0.15 * var(--gauge-circle-size)) 0 0; } .lh-gauge { stroke-linecap: round; width: var(--gauge-circle-size); height: var(--gauge-circle-size); } .lh-category .lh-gauge { --gauge-circle-size: var(--gauge-circle-size-big); } .lh-gauge-base { opacity: 0.1; } .lh-gauge-arc { fill: none; transform-origin: 50% 50%; animation: load-gauge var(--transition-length) ease both; animation-delay: 250ms; } .lh-gauge__svg-wrapper { position: relative; height: var(--gauge-circle-size); } .lh-category .lh-gauge__svg-wrapper, .lh-category .lh-fraction__wrapper { --gauge-circle-size: var(--gauge-circle-size-big); } /* The plugin badge overlay */ .lh-gauge__wrapper--plugin .lh-gauge__svg-wrapper::before { width: var(--plugin-badge-size); height: var(--plugin-badge-size); background-color: var(--plugin-badge-background-color); background-image: var(--plugin-icon-url); background-repeat: no-repeat; background-size: var(--plugin-icon-size); background-position: 58% 50%; content: ""; position: absolute; right: -6px; bottom: 0px; display: block; z-index: 100; box-shadow: 0 0 4px rgba(0,0,0,.2); border-radius: 25%; } .lh-category .lh-gauge__wrapper--plugin .lh-gauge__svg-wrapper::before { width: var(--plugin-badge-size-big); height: var(--plugin-badge-size-big); } @keyframes load-gauge { from { stroke-dasharray: 0 352; } } .lh-gauge__percentage { width: 100%; height: var(--gauge-circle-size); line-height: var(--gauge-circle-size); position: absolute; font-family: var(--report-font-family-monospace); font-size: calc(var(--gauge-circle-size) * 0.34 + 1.3px); text-align: center; top: var(--score-container-padding); } .lh-category .lh-gauge__percentage { --gauge-circle-size: var(--gauge-circle-size-big); --gauge-percentage-font-size: var(--gauge-percentage-font-size-big); } .lh-gauge__wrapper, .lh-fraction__wrapper { position: relative; display: flex; align-items: center; flex-direction: column; text-decoration: none; padding: var(--score-container-padding); --transition-length: 1s; /* Contain the layout style paint & layers during animation*/ contain: content; will-change: opacity; /* Only using for layer promotion */ } .lh-gauge__label, .lh-fraction__label { font-size: var(--gauge-label-font-size); font-weight: 500; line-height: var(--gauge-label-line-height); margin-top: 10px; text-align: center; color: var(--report-text-color); word-break: keep-all; } /* TODO(#8185) use more BEM (.lh-gauge__label--big) instead of relying on descendant selector */ .lh-category .lh-gauge__label, .lh-category .lh-fraction__label { --gauge-label-font-size: var(--gauge-label-font-size-big); --gauge-label-line-height: var(--gauge-label-line-height-big); margin-top: 14px; } .lh-scores-header .lh-gauge__wrapper, .lh-scores-header .lh-fraction__wrapper, .lh-sticky-header .lh-gauge__wrapper, .lh-sticky-header .lh-fraction__wrapper { width: var(--gauge-wrapper-width); } .lh-scorescale { display: inline-flex; gap: calc(var(--default-padding) * 4); margin: 16px auto 0 auto; font-size: var(--report-font-size-secondary); color: var(--color-gray-700); } .lh-scorescale-range { display: flex; align-items: center; font-family: var(--report-font-family-monospace); white-space: nowrap; } .lh-category-header__finalscreenshot .lh-scorescale { border: 0; display: flex; justify-content: center; } .lh-category-header__finalscreenshot .lh-scorescale-range { font-family: unset; font-size: 12px; } .lh-scorescale-wrap { display: contents; } /* Hide category score gauages if it's a single category report */ .lh-header--solo-category .lh-scores-wrapper { display: none; } .lh-categories { width: 100%; } .lh-category { padding: var(--category-padding); max-width: var(--report-content-max-width); margin: 0 auto; scroll-margin-top: calc(var(--sticky-header-buffer) - 1em); } .lh-category-wrapper { border-bottom: 1px solid var(--color-gray-200); } .lh-category-wrapper:last-of-type { border-bottom: 0; } .lh-category-header { margin-bottom: var(--section-padding-vertical); } .lh-category-header .lh-score__gauge { max-width: 400px; width: auto; margin: 0px auto; } .lh-category-header__finalscreenshot { display: grid; grid-template: none / 1fr 1px 1fr; justify-items: center; align-items: center; gap: var(--report-line-height); min-height: 288px; margin-bottom: var(--default-padding); } .lh-final-ss-image { /* constrain the size of the image to not be too large */ max-height: calc(var(--gauge-circle-size-big) * 2.8); max-width: calc(var(--gauge-circle-size-big) * 3.5); border: 1px solid var(--color-gray-200); padding: 4px; border-radius: 3px; display: block; } .lh-category-headercol--separator { background: var(--color-gray-200); width: 1px; height: var(--gauge-circle-size-big); } /** * This media query is a temporary fallback for browsers that do not support `@container query`. * TODO: remove this media query when `@container query` is fully supported by browsers * See https://github.com/GoogleChrome/lighthouse/pull/16332 */ @media screen and (max-width: 780px) { .lh-category-header__finalscreenshot { grid-template: 1fr 1fr / none } .lh-category-headercol--separator { display: none; } } @container lh-container (max-width: 780px) { .lh-category-header__finalscreenshot { grid-template: 1fr 1fr / none } .lh-category-headercol--separator { display: none; } } /** * This media query is a temporary fallback for browsers that do not support `@container query`. * TODO: remove this media query when `@container query` is fully supported by browsers * See https://github.com/GoogleChrome/lighthouse/pull/16332 */ @media screen and (max-width: 964px) { .lh-report { margin-left: 0; width: 100%; } } /* 964 fits the min-width of the filmstrip */ @container lh-container (max-width: 964px) { .lh-report { margin-left: 0; width: 100%; } } @media print { body { -webkit-print-color-adjust: exact; /* print background colors */ } .lh-container { display: block; } .lh-report { margin-left: 0; padding-top: 0; } .lh-categories { margin-top: 0; } .lh-buttons, .lh-highlighter { /* hide stickyheader marker when printing. crbug.com/41486992 */ display: none; } } .lh-table { position: relative; border-collapse: separate; border-spacing: 0; /* Can't assign padding to table, so shorten the width instead. */ width: calc(100% - var(--audit-description-padding-left) - var(--stackpack-padding-horizontal)); border: 1px solid var(--report-border-color-secondary); } .lh-table thead th { position: sticky; top: var(--sticky-header-buffer); z-index: 1; background-color: var(--report-background-color); border-bottom: 1px solid var(--report-border-color-secondary); font-weight: normal; color: var(--color-gray-600); /* See text-wrapping comment on .lh-container. */ word-break: normal; } .lh-row--group { background-color: var(--table-group-header-background-color); } .lh-row--group td { font-weight: bold; font-size: 1.05em; color: var(--table-group-header-text-color); } .lh-row--group td:first-child { display: block; min-width: max-content; font-weight: normal; } .lh-row--group .lh-text { color: inherit; text-decoration: none; display: inline-block; } .lh-row--group a.lh-link:hover { text-decoration: underline; } .lh-row--group .lh-audit__adorn { text-transform: capitalize; font-weight: normal; padding: 2px 3px 1px 3px; } .lh-row--group .lh-audit__adorn1p { color: var(--link-color); border-color: var(--link-color); } .lh-row--group .lh-report-icon--external::before { content: ""; background-repeat: no-repeat; width: 14px; height: 16px; opacity: 0.7; display: inline-block; vertical-align: middle; } .lh-row--group .lh-report-icon--external { visibility: hidden; } .lh-row--group:hover .lh-report-icon--external { visibility: visible; } .lh-dark .lh-report-icon--external::before { filter: invert(1); } /** Manages indentation of two-level and three-level nested adjacent rows */ .lh-row--group ~ [data-entity]:not(.lh-row--group) td:first-child { padding-left: 20px; } .lh-row--group ~ [data-entity]:not(.lh-row--group) ~ .lh-sub-item-row td:first-child { margin-left: 20px; padding-left: 10px; border-left: 1px solid #A8C7FA; display: block; } .lh-row--even { background-color: var(--table-group-header-background-color); } .lh-row--hidden { display: none; } .lh-table th, .lh-table td { padding: var(--default-padding); } .lh-table tr { vertical-align: middle; } .lh-table tr:hover { background-color: var(--table-higlight-background-color); } /* Looks unnecessary, but mostly for keeping the