update md

This commit is contained in:
lutinglt
2025-08-11 09:26:10 +08:00
parent 1d8dfdb82b
commit ffbfccd7dc
6 changed files with 24 additions and 14 deletions

View File

@@ -59,7 +59,7 @@ type ThemeColor = {
/** 定义颜色, 用于生成颜色主题
* @example
* 文件名: "dark.css.ts"
* import type { Console, Diff, Other } from "src/types";
* import type { Console, Diff, Other, Github } from "src/types";
* import { defineTheme, themeVars } from "src";
*
* const console: Console = {
@@ -78,6 +78,7 @@ type ThemeColor = {
* console,
* diff,
* other,
* github,
* })
*/
export function defineTheme(themeColor: ThemeColor, chroma: Chroma | null = null): Theme {

View File

@@ -1,6 +1,12 @@
import type { CSSVarFunction } from "src/core/types";
type CSSFallbackVar = `var(--${string}, ${string})`;
/**
* 设置 CSS 变量的回退值
* @param cssvar `var(--${string})`
* @param fallback
* @returns `var(--${string}, fallback)`
*/
export function fallbackVar(cssvar: CSSVarFunction, fallback: string): CSSFallbackVar {
const var_name = cssvar.replace("var(--", "").replace(")", "");
return `var(--${var_name}, ${fallback})`;

View File

@@ -1,3 +1,4 @@
export { defineTheme } from "./core/color";
export type { Chroma, Console, Diff, Other } from "./types";
export { themeVars } from "./types/vars";
export type { Theme } from "./core/theme";
export type { Chroma, Console, Diff, Github, Other } from "./types";
export { otherThemeVars, themeVars } from "./types/vars";

View File

@@ -201,17 +201,17 @@ export const github = {
/** 热力图 */
contribution: {
default: {
/** 热力图方块的颜色 */
bgColor: {
num0: null,
num1: null,
num2: null,
num3: null,
num4: null,
/** github 无此颜色需自行计算
* @example 可参考这个颜色 `--color-prettylights-syntax-string-regexp`
*/
/** github 无此颜色需自行计算 */
num5: null,
},
/** 热力图方块的内边框颜色 */
borderColor: {
num0: null,
num1: null,