MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / zIndex

Function zIndex

graph-ui/src/galaxy/hover-layer.test.tsx:39–51  ·  view source on GitHub ↗

The z-index of the last rule whose selector list names `selector` exactly, across the given sheets.

(selector: string, ...files: string[])

Source from the content-addressed store, hash-verified

37
38/** The z-index of the last rule whose selector list names `selector` exactly, across the given sheets. */
39function zIndex(selector: string, ...files: string[]): number {
40 let found: number | undefined;
41 for (const file of files) {
42 const css = readFileSync(new URL(file, import.meta.url), 'utf8').replace(/\/\*[\s\S]*?\*\//g, '');
43 for (const match of css.matchAll(/([^{}]+)\{([^}]*)\}/g)) {
44 if (!match[1]!.split(',').map(item => item.trim()).includes(selector)) continue;
45 const value = /z-index:\s*(\d+)/.exec(match[2]!)?.[1];
46 if (value !== undefined) found = Number(value);
47 }
48 }
49 expect(found, selector).toBeDefined();
50 return found!;
51}
52const SHEETS = ['./graph-exploration.css', '../styles/terminal.css', '../why/selection-context.css'];
53
54describe('K29: the hover card stands above the Galaxy panels', () => {

Callers 1

Calls 1

expectFunction · 0.85

Tested by

no test coverage detected