mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2025-10-26 13:00:31 +00:00
探索/组织/用户仓库样式 github 布局 (#8)
Co-authored-by: lutinglt <lutinglt@users.noreply.github.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
type Primitive = string | boolean | number | null | undefined;
|
||||
type Tokens = { [key: string]: string | Tokens };
|
||||
|
||||
export type CSSVarFunction = `var(--${string})`;
|
||||
export type WithOptionalLayer<T extends Tokens> = T & { "@layer"?: string };
|
||||
|
||||
export type MapLeafNodes<Obj, LeafType> = {
|
||||
[Prop in keyof Obj]: Obj[Prop] extends Primitive
|
||||
? LeafType
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export { scaleColorLight } from "./scss";
|
||||
export { fallbackVar } from "./var";
|
||||
|
||||
7
src/functions/var.ts
Normal file
7
src/functions/var.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { CSSVarFunction } from "src/core/types";
|
||||
|
||||
type CSSFallbackVar = `var(--${string}, ${string})`;
|
||||
export function fallbackVar(cssvar: CSSVarFunction, fallback: string): CSSFallbackVar {
|
||||
const var_name = cssvar.replace("var(--", "").replace(")", "");
|
||||
return `var(--${var_name}, ${fallback})`;
|
||||
}
|
||||
@@ -38,6 +38,15 @@ const otherVars = {
|
||||
const customVars = {
|
||||
custom: {
|
||||
cloneMenuWidth: "custom-clone-menu-width",
|
||||
explore: {
|
||||
repolistColumns: "custom-explore-repolist-columns",
|
||||
userlistColumns: "custom-explore-userlist-columns",
|
||||
},
|
||||
userRepolistColumns: "custom-user-repolist-columns",
|
||||
org: {
|
||||
repolistColumns: "custom-org-repolist-columns",
|
||||
userlistColumns: "custom-org-userlist-columns",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user