All files / player-ui/src/themes basecoat.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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160                    44x                                                                                                                                                                                                                                                                                                          
import { css, unsafeCSS } from 'lit';
import type { BeMusicTheme } from '../theme.ts';
import { BASECOAT_THEME_CSS } from './basecoat.generated.ts';
 
/**
 * The Basecoat look: Basecoat's components (the elements' buttons, fields and selects carry its class names) and the
 * colours, borders and backgrounds of the elements' own parts, all from the page's Basecoat tokens (`--background`,
 * `--card`, `--border`, `--primary`, `--muted-foreground`, `--radius` and the rest), which inherit into the shadow
 * roots. Pass it to `defineBeMusicElements(registry, { theme: basecoatTheme })`.
 */
export const basecoatTheme: BeMusicTheme = [
  unsafeCSS(BASECOAT_THEME_CSS),
  css`
    :host {
      color: var(--foreground, #edf2fa);
      font-family: var(--font-sans, system-ui, sans-serif);
    }
    .muted,
    .artist,
    .facts,
    dt,
    th,
    .eyebrow,
    .panel h3,
    label:not([part~='meter']),
    summary {
      color: var(--muted-foreground, #9baac0);
    }
    tbody th {
      color: inherit;
    }
    .panel,
    .hud-primary {
      background: var(--card, #18181b);
      color: var(--card-foreground, inherit);
      border: 1px solid var(--border, #ffffff1a);
      border-radius: var(--radius, 0.625rem);
    }
    .panel h3 {
      font-weight: 600;
    }
    progress {
      appearance: none;
      height: 6px;
      border: 0;
      border-radius: 999px;
      overflow: hidden;
      background: var(--muted, #27272a);
    }
    progress::-webkit-progress-bar {
      background: var(--muted, #27272a);
    }
    progress::-webkit-progress-value {
      background: var(--primary, #edf2fa);
    }
    progress::-moz-progress-bar {
      background: var(--primary, #edf2fa);
    }
    .screen,
    :host(be-music-preview-select) {
      background: var(--background, #171717);
    }
    .search-error {
      color: var(--destructive, #f87171);
    }
    /* The chart list: the current row filled, the level in the primary colour. */
    [part~='row'] {
      border-color: transparent;
    }
    [part~='row'][aria-current='true'] {
      background: var(--accent, #293d59);
      color: var(--accent-foreground, inherit);
      border-color: var(--border, transparent);
    }
    [part~='row-kind'] {
      color: var(--primary, #abcaff);
    }
    /* A gauge inside a result's panel: a rule above it instead of a box of its own. */
    .player > be-music-gauge-panel::part(panel) {
      background: none;
      border: 0;
      border-top: 1px solid var(--border, #ffffff1a);
      border-radius: 0;
    }
    [part~='paused'] {
      background: color-mix(in oklch, var(--background, #09090b) 80%, transparent);
      border-radius: var(--radius, 0.625rem);
    }
    .gameplay[data-orientation='portrait'] .hud-primary {
      background: transparent;
      border: 0;
    }
    .gameplay[data-orientation='portrait'] .hud-details > summary {
      border-radius: calc(var(--radius, 0.625rem) - 4px);
      background: var(--accent, #3f3f46);
      color: var(--accent-foreground, inherit);
    }
    .gameplay[data-orientation='portrait'] .hud-extra {
      background: color-mix(in oklch, var(--background, #09090b) 96%, transparent);
      border: 1px solid var(--border, #ffffff1a);
      border-radius: var(--radius, 0.625rem);
    }
    .thumb {
      background: var(--muted, #0c1018);
      border-radius: calc(var(--radius, 0.625rem) - 4px);
    }
    /* The cabinet arrangement of the gameplay HUD. */
    .cabinet .play-frame {
      border: 1px solid var(--border, #ffffff1a);
      border-radius: var(--radius, 0.625rem);
    }
    .cabinet .chart-progress {
      background: var(--muted, #27272a);
      border-radius: 999px;
    }
    .cabinet .progress-fill {
      background: var(--primary, #edf2fa);
      opacity: 1;
    }
    .cabinet .key {
      color: var(--foreground, #edf2fa);
    }
    .cabinet .key[data-kind='black'],
    .cabinet .key[data-kind='scratch'],
    .cabinet .key[data-kind='wheel-up'],
    .cabinet .key[data-kind='wheel-down'] {
      color: var(--muted-foreground, #9baac0);
    }
    .cabinet .bar[data-kind='you'] {
      color: var(--primary, #edf2fa);
    }
    .cabinet .bar[data-kind='best'] {
      color: var(--chart-2, #34d399);
    }
    .cabinet .bar[data-kind='target'] {
      color: var(--destructive, #f87171);
    }
    .cabinet .difficulty {
      background: var(--primary, #edf2fa);
      color: var(--primary-foreground, #18181b);
    }
    .cabinet .fast,
    .cabinet .timing-mark[data-side='early'] {
      color: var(--chart-1, #60a5fa);
    }
    .cabinet .slow,
    .cabinet .timing-mark[data-side='late'] {
      color: var(--destructive, #f87171);
    }
    .cabinet .pacemaker {
      border-color: var(--border, #ffffff1a);
    }
    .cabinet .cabinet-details {
      background: color-mix(in oklch, var(--background, #09090b) 96%, transparent);
      border: 1px solid var(--border, #ffffff1a);
      border-radius: var(--radius, 0.625rem);
    }
  `,
];