mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-10 09:41:52 +02:00
test: use named path import in theme contrast test
Co-Authored-By: Hermes Agent <hermes@noreply.local>
This commit is contained in:
parent
b034849778
commit
1a1d349b85
@ -1,10 +1,10 @@
|
||||
import {readFile} from 'node:fs/promises';
|
||||
import * as path from 'node:path';
|
||||
import {join} from 'node:path';
|
||||
|
||||
type CssVariables = Record<string, string>;
|
||||
|
||||
async function loadThemeVariables(fileName: string, baseVariables: CssVariables = {}): Promise<CssVariables> {
|
||||
const themePath = path.join(import.meta.dirname, '../../css/themes', fileName);
|
||||
const themePath = join(import.meta.dirname, '../../css/themes', fileName);
|
||||
const css = await readFile(themePath, 'utf8');
|
||||
const variables = {...baseVariables};
|
||||
for (const match of css.matchAll(/(--[\w-]+):\s*(#[\dA-Fa-f]{6});/g)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user