.perfChart { max-width: 500px; margin: 0 auto var(--ifm-leading); } .bars { display: grid; /* min widths keep bar tracks the same size across charts */ grid-template-columns: minmax(6.5rem, max-content) 1fr minmax( 3rem, max-content ); align-items: center; gap: 0.5rem 0.75rem; } .row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; border-radius: var(--ifm-global-radius); cursor: default; } .row:focus-visible, .row[data-open] { outline: none; background: var(--ifm-color-emphasis-100); } @media (hover: hover) { .row:hover { background: var(--ifm-color-emphasis-100); } } /* exact numbers, revealed on hover, tap or keyboard focus */ .tip { composes: tip from './tips.module.css'; left: 50%; translate: -50%; white-space: nowrap; --tip-pointer-events: none; } .label { font-size: 0.875rem; color: var(--ifm-color-emphasis-700); } .track, .oneLabel { position: relative; } /* dashed 1x marker across every row */ .track::after { content: ''; position: absolute; top: -0.25rem; bottom: -0.25rem; left: var(--perf-one); border-left: 2px dashed var(--ifm-color-emphasis-600); } .oneLabel { left: var(--perf-one); width: max-content; transform: translateX(-50%); font-size: 0.75rem; line-height: 1; color: var(--ifm-color-emphasis-700); } .bar { display: block; height: 1.25rem; min-width: 2px; border-radius: 0 4px 4px 0; /* the part up to 1x is the baseline; the bright part is the gain */ background: linear-gradient( to right, var(--ifm-color-emphasis-300) var(--perf-split, 0), var(--ifm-color-primary) var(--perf-split, 0) ); } .shortfall { position: absolute; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--ifm-color-danger-contrast-background); border: 1px dashed var(--ifm-color-danger); } .worse { font-weight: var(--ifm-font-weight-bold); color: var(--ifm-color-danger); }