All files / player-ui/src/styles structure.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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              49x                                                                                                                                                                                  
import { css, type CSSResult } from 'lit';
 
/**
 * Structure every element shares: layout, sizing and scrolling, and nothing a theme decides. No colour, border,
 * background or font family is set here; spacing reads the `--be-music-*` lengths documented in the package README, with
 * small defaults so an unthemed element still reads. A theme (`setBeMusicTheme`) adds the look.
 */
export const structureStyles: CSSResult = css`
  :host {
    display: block;
    min-width: 0;
    container-type: inline-size;
    container-name: be-music;
    font: inherit;
  }
  * {
    box-sizing: border-box;
  }
  h1,
  h2,
  h3,
  p {
    margin: 0;
  }
  [hidden] {
    display: none !important;
  }
  .muted {
    font-size: 0.85em;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  dl {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px var(--be-music-gap, 8px);
    margin: 0;
    font-size: 0.85em;
  }
  dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }
  .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--be-music-gap, 8px);
  }
  /* A titled box of related figures. */
  .panel {
    display: grid;
    align-content: start;
    gap: var(--be-music-gap, 8px);
    min-width: 0;
    padding: var(--be-music-panel-padding, 12px);
  }
  .panel h3 {
    font-size: 0.85em;
    line-height: 1.2;
  }
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    font-variant-numeric: tabular-nums;
  }
  th,
  td {
    padding: 2px 0 2px var(--be-music-gap, 8px);
    text-align: right;
  }
  th:first-child,
  td:first-child {
    padding-left: 0;
    text-align: left;
  }
  /* Graphs stretch to the panel's width at a fixed height; their strokes keep their width. */
  svg {
    display: block;
    width: 100%;
    height: var(--be-music-graph-height, 44px);
    overflow: visible;
  }
  svg * {
    vector-effect: non-scaling-stroke;
  }
  progress,
  meter {
    display: block;
    width: 100%;
    min-width: 0;
  }
`;