@wrikka/theme 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -2
- package/dist/brand-CzIW-imW.d.mts +72 -0
- package/dist/css-vars-vNnaKbWz.mjs +859 -0
- package/dist/index.d.mts +92 -0
- package/dist/index.mjs +97 -0
- package/dist/preset.d.mts +25 -0
- package/dist/preset.mjs +190 -0
- package/package.json +51 -5
- package/src/styles/markdown.css +87 -0
- package/src/styles/theme.css +247 -0
- package/src/styles/tokens.css +311 -0
- package/src/styles/tokens.dtcg.json +3656 -0
- package/tokens.json +535 -0
- package/uno.config.ts +246 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { _ as ThemeState, a as brandRamp, c as readableForeground, d as ThemeColor, f as ThemeFont, g as ThemeSpace, h as ThemeRadius, i as brandForMode, l as ColorScheme, m as ThemePreset, n as BrandPair, o as brandVars, p as ThemeMode, r as BrandRamp, s as normalizeBrand, t as BrandInput, u as ColorSet } from "./brand-CzIW-imW.mjs";
|
|
2
|
+
//#region src/theme/color-math.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Color math shared by the brand ramp and the token health audit.
|
|
5
|
+
*
|
|
6
|
+
* Colors travel through the theme as CSS "h s% l%" triplets, so every helper
|
|
7
|
+
* accepts that form (or hex) and returns plain sRGB components.
|
|
8
|
+
*/
|
|
9
|
+
export type Rgb = [number, number, number];
|
|
10
|
+
export declare const isHslTriplet: (value: string) => boolean;
|
|
11
|
+
/** Parse an "h s% l%" triplet into sRGB components in the 0–1 range. */
|
|
12
|
+
export declare function hslTripletToRgb(triplet: string): Rgb | undefined;
|
|
13
|
+
/** Parse a six-digit hex color into sRGB components in the 0–1 range. */
|
|
14
|
+
export declare function hexToRgb(hex: string): Rgb | undefined;
|
|
15
|
+
/** Convert a six-digit hex color into the "h s% l%" triplet theme.css uses. */
|
|
16
|
+
export declare function hexToHslTriplet(hex: string): string | undefined;
|
|
17
|
+
export declare function rgbToHslTriplet(rgb: Rgb): string;
|
|
18
|
+
/** WCAG 2.1 relative luminance. */
|
|
19
|
+
export declare function relativeLuminance([r, g, b]: Rgb): number;
|
|
20
|
+
/** WCAG 2.1 contrast ratio between two sRGB colors (1–21). */
|
|
21
|
+
export declare function contrastRatio(a: Rgb, b: Rgb): number;
|
|
22
|
+
/** Contrast between two "h s% l%" triplets; undefined when either fails to parse. */
|
|
23
|
+
export declare function tripletContrast(a: string, b: string): number | undefined;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/theme/colors.d.ts
|
|
26
|
+
export declare const colorSchemes: Record<Exclude<ThemeColor, "auto">, ColorScheme>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/theme/css-vars.d.ts
|
|
29
|
+
/** Soft/ink/deep surfaces for the families that carry them; neutral accent has no family. */
|
|
30
|
+
export declare function softVars(colorSet: ColorSet, mode: ThemeMode): Record<string, string>;
|
|
31
|
+
/** Same lightness adjustments applyThemeState uses at runtime. */
|
|
32
|
+
export declare function varsForMode(colorSet: ColorSet, mode: ThemeMode): Record<string, string>;
|
|
33
|
+
export declare function varsForState(state: Pick<ThemeState, "font" | "space" | "radius">): Record<string, string>;
|
|
34
|
+
/**
|
|
35
|
+
* Emit a complete theme.css for a ThemeState — light vars on :root, dark vars
|
|
36
|
+
* under [data-theme="dark"], plus the font/space/radius tokens on :root.
|
|
37
|
+
*/
|
|
38
|
+
export declare function cssVarsForTheme(state: ThemeState, color?: Exclude<ThemeColor, "auto">): string;
|
|
39
|
+
/**
|
|
40
|
+
* Brand override layer: the full primary ramp for both modes, meant to be
|
|
41
|
+
* emitted after cssVarsForTheme so it wins on cascade order.
|
|
42
|
+
*/
|
|
43
|
+
export declare function brandCssVars(brand: BrandInput): string;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/theme/hsl.d.ts
|
|
46
|
+
export declare function hsl(h: number, s: number, l: number): string;
|
|
47
|
+
/** Shift the lightness channel of an "h s% l%" string, clamped to 0–100. */
|
|
48
|
+
export declare function adjustLightness(hslValue: string, delta: number): string;
|
|
49
|
+
/** Low-emphasis surface of a family color, tuned per mode. */
|
|
50
|
+
export declare function softTriplet(value: string, mode: ThemeMode): string;
|
|
51
|
+
/** Readable text color for a family, for use on its `soft` surface. */
|
|
52
|
+
export declare function inkTriplet(value: string, mode: ThemeMode): string;
|
|
53
|
+
/** Emphasised fill of a family color (darker in both modes). */
|
|
54
|
+
export declare function deepTriplet(value: string): string;
|
|
55
|
+
/** Translucent brand levels applied over any surface: `hsl(var(--color-primary) / var(--su-alpha-<level>))`. */
|
|
56
|
+
export declare function alphaVars(mode: ThemeMode): Record<string, string>;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/theme/presets.d.ts
|
|
59
|
+
/**
|
|
60
|
+
* Weekday themes ΓÇö Thai weekday colors: Sunday red, Monday yellow,
|
|
61
|
+
* Tuesday pink, Wednesday green, Thursday orange, Friday blue,
|
|
62
|
+
* Saturday violet. Matches `weekdayColors` in store.ts.
|
|
63
|
+
*/
|
|
64
|
+
export declare const presets: ThemePreset[];
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/theme/scales.d.ts
|
|
67
|
+
export declare const fontStacks: Record<ThemeFont, string>;
|
|
68
|
+
/**
|
|
69
|
+
* Line heights per font. Thai stacks carry stacked vowels and tone marks above
|
|
70
|
+
* and below the baseline, so they need more air than a Latin-only face at the
|
|
71
|
+
* same size.
|
|
72
|
+
*/
|
|
73
|
+
export declare const leadingScales: Record<ThemeFont, Record<"none" | "tight" | "normal" | "relaxed", string>>;
|
|
74
|
+
export declare const spaceScales: Record<ThemeSpace, Record<string, string>>;
|
|
75
|
+
/** Control metrics that follow the space scale, exposed as --su-control-h-*, --su-row-h and --su-gutter. */
|
|
76
|
+
export interface DensityMetrics {
|
|
77
|
+
controlSm: string;
|
|
78
|
+
controlMd: string;
|
|
79
|
+
controlLg: string;
|
|
80
|
+
row: string;
|
|
81
|
+
gutter: string;
|
|
82
|
+
}
|
|
83
|
+
export declare const densityScales: Record<ThemeSpace, DensityMetrics>;
|
|
84
|
+
export declare const radiusScales: Record<ThemeRadius, {
|
|
85
|
+
DEFAULT: string;
|
|
86
|
+
sm: string;
|
|
87
|
+
md: string;
|
|
88
|
+
lg: string;
|
|
89
|
+
xl: string;
|
|
90
|
+
}>;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { BrandInput, BrandPair, BrandRamp, ColorScheme, ColorSet, ThemeColor, ThemeFont, ThemeMode, ThemePreset, ThemeRadius, ThemeSpace, ThemeState, brandForMode, brandRamp, brandVars, normalizeBrand, readableForeground };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { A as tripletContrast, C as contrastRatio, D as isHslTriplet, E as hslTripletToRgb, O as relativeLuminance, S as softTriplet, T as hexToRgb, _ as adjustLightness, a as varsForState, b as hsl, c as leadingScales, d as colorSchemes, f as brandForMode, g as readableForeground, h as normalizeBrand, i as varsForMode, k as rgbToHslTriplet, l as radiusScales, m as brandVars, n as cssVarsForTheme, o as densityScales, p as brandRamp, r as softVars, s as fontStacks, t as brandCssVars, u as spaceScales, v as alphaVars, w as hexToHslTriplet, x as inkTriplet, y as deepTriplet } from "./css-vars-vNnaKbWz.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/theme/presets.ts
|
|
4
|
+
/**
|
|
5
|
+
* Weekday themes ΓÇö Thai weekday colors: Sunday red, Monday yellow,
|
|
6
|
+
* Tuesday pink, Wednesday green, Thursday orange, Friday blue,
|
|
7
|
+
* Saturday violet. Matches `weekdayColors` in store.ts.
|
|
8
|
+
*/
|
|
9
|
+
const presets = [
|
|
10
|
+
{
|
|
11
|
+
name: "sunday",
|
|
12
|
+
label: "Sunday",
|
|
13
|
+
state: {
|
|
14
|
+
name: "Sunday",
|
|
15
|
+
mode: "dark",
|
|
16
|
+
color: "red",
|
|
17
|
+
font: "sans",
|
|
18
|
+
space: "normal",
|
|
19
|
+
radius: "medium"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "monday",
|
|
24
|
+
label: "Monday",
|
|
25
|
+
state: {
|
|
26
|
+
name: "Monday",
|
|
27
|
+
mode: "dark",
|
|
28
|
+
color: "yellow",
|
|
29
|
+
font: "sans",
|
|
30
|
+
space: "normal",
|
|
31
|
+
radius: "medium"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "tuesday",
|
|
36
|
+
label: "Tuesday",
|
|
37
|
+
state: {
|
|
38
|
+
name: "Tuesday",
|
|
39
|
+
mode: "dark",
|
|
40
|
+
color: "pink",
|
|
41
|
+
font: "serif",
|
|
42
|
+
space: "normal",
|
|
43
|
+
radius: "large"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "wednesday",
|
|
48
|
+
label: "Wednesday",
|
|
49
|
+
state: {
|
|
50
|
+
name: "Wednesday",
|
|
51
|
+
mode: "dark",
|
|
52
|
+
color: "green",
|
|
53
|
+
font: "sans",
|
|
54
|
+
space: "spacious",
|
|
55
|
+
radius: "small"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "thursday",
|
|
60
|
+
label: "Thursday",
|
|
61
|
+
state: {
|
|
62
|
+
name: "Thursday",
|
|
63
|
+
mode: "dark",
|
|
64
|
+
color: "orange",
|
|
65
|
+
font: "sans",
|
|
66
|
+
space: "normal",
|
|
67
|
+
radius: "medium"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "friday",
|
|
72
|
+
label: "Friday",
|
|
73
|
+
state: {
|
|
74
|
+
name: "Friday",
|
|
75
|
+
mode: "dark",
|
|
76
|
+
color: "blue",
|
|
77
|
+
font: "sans",
|
|
78
|
+
space: "normal",
|
|
79
|
+
radius: "medium"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "saturday",
|
|
84
|
+
label: "Saturday",
|
|
85
|
+
state: {
|
|
86
|
+
name: "Saturday",
|
|
87
|
+
mode: "dark",
|
|
88
|
+
color: "violet",
|
|
89
|
+
font: "sans",
|
|
90
|
+
space: "compact",
|
|
91
|
+
radius: "large"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
export { adjustLightness, alphaVars, brandCssVars, brandForMode, brandRamp, brandVars, colorSchemes, contrastRatio, cssVarsForTheme, deepTriplet, densityScales, fontStacks, hexToHslTriplet, hexToRgb, hsl, hslTripletToRgb, inkTriplet, isHslTriplet, leadingScales, normalizeBrand, presets, radiusScales, readableForeground, relativeLuminance, rgbToHslTriplet, softTriplet, softVars, spaceScales, tripletContrast, varsForMode, varsForState };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { _ as ThemeState, t as BrandInput } from "./brand-CzIW-imW.mjs";
|
|
2
|
+
import { Preset } from "unocss";
|
|
3
|
+
//#region src/preset.d.ts
|
|
4
|
+
export interface PresetSolidUIOptions {
|
|
5
|
+
color?: ThemeState["color"];
|
|
6
|
+
font?: ThemeState["font"];
|
|
7
|
+
space?: ThemeState["space"];
|
|
8
|
+
radius?: ThemeState["radius"];
|
|
9
|
+
mode?: ThemeState["mode"];
|
|
10
|
+
/**
|
|
11
|
+
* Brand color (hex or "h s% l%" triplet) that derives the whole primary ramp;
|
|
12
|
+
* pass `{ light, dark }` when dark mode needs a brighter fill.
|
|
13
|
+
*/
|
|
14
|
+
brand?: BrandInput;
|
|
15
|
+
/** Emit a preflight that sets every --color-* and --su-* token on :root/[data-theme]. Default true. */
|
|
16
|
+
preflight?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* UnoCSS preset that maps the solid-ui design tokens to CSS variables.
|
|
20
|
+
* Utilities like `bg-primary`, `text-muted-foreground`, `rounded-lg` resolve to
|
|
21
|
+
* `var(--color-*)` / `var(--su-*)` so themes can be swapped at runtime.
|
|
22
|
+
*/
|
|
23
|
+
export declare function presetSolidUI(options?: PresetSolidUIOptions): Preset;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { presetSolidUI as default };
|
package/dist/preset.mjs
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { n as cssVarsForTheme, t as brandCssVars } from "./css-vars-vNnaKbWz.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/preset.ts
|
|
4
|
+
/**
|
|
5
|
+
* UnoCSS preset that maps the solid-ui design tokens to CSS variables.
|
|
6
|
+
* Utilities like `bg-primary`, `text-muted-foreground`, `rounded-lg` resolve to
|
|
7
|
+
* `var(--color-*)` / `var(--su-*)` so themes can be swapped at runtime.
|
|
8
|
+
*/
|
|
9
|
+
function presetSolidUI(options = {}) {
|
|
10
|
+
const state = {
|
|
11
|
+
name: "custom",
|
|
12
|
+
mode: options.mode ?? "light",
|
|
13
|
+
color: options.color ?? "blue",
|
|
14
|
+
font: options.font ?? "sans",
|
|
15
|
+
space: options.space ?? "normal",
|
|
16
|
+
radius: options.radius ?? "medium"
|
|
17
|
+
};
|
|
18
|
+
const brandCss = options.brand ? brandCssVars(options.brand) : "";
|
|
19
|
+
return {
|
|
20
|
+
name: "@wrikka/theme/preset",
|
|
21
|
+
theme: {
|
|
22
|
+
colors: {
|
|
23
|
+
background: "hsl(var(--color-background))",
|
|
24
|
+
foreground: "hsl(var(--color-foreground))",
|
|
25
|
+
primary: {
|
|
26
|
+
DEFAULT: "hsl(var(--color-primary))",
|
|
27
|
+
hover: "hsl(var(--color-primary-hover))",
|
|
28
|
+
active: "hsl(var(--color-primary-active))",
|
|
29
|
+
foreground: "hsl(var(--color-primary-foreground))",
|
|
30
|
+
soft: {
|
|
31
|
+
DEFAULT: "hsl(var(--color-primary-soft))",
|
|
32
|
+
foreground: "hsl(var(--color-primary-soft-foreground))"
|
|
33
|
+
},
|
|
34
|
+
ink: "hsl(var(--color-primary-ink))",
|
|
35
|
+
deep: "hsl(var(--color-primary-deep))",
|
|
36
|
+
tint: "hsl(var(--color-primary) / var(--su-alpha-tint))",
|
|
37
|
+
"tint-strong": "hsl(var(--color-primary) / var(--su-alpha-tint-strong))",
|
|
38
|
+
faint: "hsl(var(--color-primary) / var(--su-alpha-faint))",
|
|
39
|
+
wash: "hsl(var(--color-primary) / var(--su-alpha-wash))"
|
|
40
|
+
},
|
|
41
|
+
secondary: {
|
|
42
|
+
DEFAULT: "hsl(var(--color-secondary))",
|
|
43
|
+
hover: "hsl(var(--color-secondary-hover))",
|
|
44
|
+
active: "hsl(var(--color-secondary-active))",
|
|
45
|
+
foreground: "hsl(var(--color-secondary-foreground))"
|
|
46
|
+
},
|
|
47
|
+
accent: {
|
|
48
|
+
DEFAULT: "hsl(var(--color-accent))",
|
|
49
|
+
hover: "hsl(var(--color-accent-hover))",
|
|
50
|
+
active: "hsl(var(--color-accent-active))",
|
|
51
|
+
foreground: "hsl(var(--color-accent-foreground))"
|
|
52
|
+
},
|
|
53
|
+
muted: {
|
|
54
|
+
DEFAULT: "hsl(var(--color-muted))",
|
|
55
|
+
foreground: "hsl(var(--color-muted-foreground))"
|
|
56
|
+
},
|
|
57
|
+
destructive: {
|
|
58
|
+
DEFAULT: "hsl(var(--color-destructive))",
|
|
59
|
+
hover: "hsl(var(--color-destructive-hover))",
|
|
60
|
+
active: "hsl(var(--color-destructive-active))",
|
|
61
|
+
foreground: "hsl(var(--color-destructive-foreground))",
|
|
62
|
+
soft: {
|
|
63
|
+
DEFAULT: "hsl(var(--color-destructive-soft))",
|
|
64
|
+
foreground: "hsl(var(--color-destructive-soft-foreground))"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
success: {
|
|
68
|
+
DEFAULT: "hsl(var(--color-success))",
|
|
69
|
+
foreground: "hsl(var(--color-success-foreground))",
|
|
70
|
+
soft: {
|
|
71
|
+
DEFAULT: "hsl(var(--color-success-soft))",
|
|
72
|
+
foreground: "hsl(var(--color-success-soft-foreground))"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
warning: {
|
|
76
|
+
DEFAULT: "hsl(var(--color-warning))",
|
|
77
|
+
foreground: "hsl(var(--color-warning-foreground))",
|
|
78
|
+
soft: {
|
|
79
|
+
DEFAULT: "hsl(var(--color-warning-soft))",
|
|
80
|
+
foreground: "hsl(var(--color-warning-soft-foreground))"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
info: {
|
|
84
|
+
DEFAULT: "hsl(var(--color-info))",
|
|
85
|
+
foreground: "hsl(var(--color-info-foreground))",
|
|
86
|
+
soft: {
|
|
87
|
+
DEFAULT: "hsl(var(--color-info-soft))",
|
|
88
|
+
foreground: "hsl(var(--color-info-soft-foreground))"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
border: {
|
|
92
|
+
DEFAULT: "hsl(var(--color-border))",
|
|
93
|
+
hover: "hsl(var(--color-border-hover))"
|
|
94
|
+
},
|
|
95
|
+
input: "hsl(var(--color-input))",
|
|
96
|
+
ring: "hsl(var(--color-ring))",
|
|
97
|
+
surface: {
|
|
98
|
+
DEFAULT: "hsl(var(--color-surface))",
|
|
99
|
+
foreground: "hsl(var(--color-surface-foreground))",
|
|
100
|
+
elevated: "hsl(var(--color-surface-elevated))"
|
|
101
|
+
},
|
|
102
|
+
card: {
|
|
103
|
+
DEFAULT: "hsl(var(--color-surface))",
|
|
104
|
+
foreground: "hsl(var(--color-surface-foreground))"
|
|
105
|
+
},
|
|
106
|
+
focus: "hsl(var(--color-focus))",
|
|
107
|
+
overlay: "hsl(var(--color-overlay))",
|
|
108
|
+
scrim: "hsl(var(--color-scrim))",
|
|
109
|
+
skeleton: {
|
|
110
|
+
DEFAULT: "hsl(var(--color-skeleton))",
|
|
111
|
+
shine: "hsl(var(--color-skeleton-shine))"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
fontFamily: {
|
|
115
|
+
sans: "var(--su-font-sans)",
|
|
116
|
+
mono: "var(--su-font-mono)"
|
|
117
|
+
},
|
|
118
|
+
fontSize: {
|
|
119
|
+
"3xs": "var(--su-text-3xs)",
|
|
120
|
+
"2xs": "var(--su-text-2xs)",
|
|
121
|
+
xs: "var(--su-text-xs)",
|
|
122
|
+
sm: "var(--su-text-sm)",
|
|
123
|
+
base: "var(--su-text-base)",
|
|
124
|
+
lg: "var(--su-text-lg)",
|
|
125
|
+
xl: "var(--su-text-xl)",
|
|
126
|
+
"2xl": "var(--su-text-2xl)",
|
|
127
|
+
"3xl": "var(--su-text-3xl)",
|
|
128
|
+
"4xl": "var(--su-text-4xl)",
|
|
129
|
+
"5xl": "var(--su-text-5xl)",
|
|
130
|
+
"6xl": "var(--su-text-6xl)",
|
|
131
|
+
"7xl": "var(--su-text-7xl)",
|
|
132
|
+
"8xl": "var(--su-text-8xl)",
|
|
133
|
+
"9xl": "var(--su-text-9xl)"
|
|
134
|
+
},
|
|
135
|
+
lineHeight: {
|
|
136
|
+
none: "var(--su-leading-none)",
|
|
137
|
+
tight: "var(--su-leading-tight)",
|
|
138
|
+
normal: "var(--su-leading-normal)",
|
|
139
|
+
relaxed: "var(--su-leading-relaxed)"
|
|
140
|
+
},
|
|
141
|
+
spacing: { gutter: "var(--su-gutter)" },
|
|
142
|
+
transitionDuration: {
|
|
143
|
+
fast: "var(--su-duration-fast)",
|
|
144
|
+
normal: "var(--su-duration-normal)",
|
|
145
|
+
slow: "var(--su-duration-slow)",
|
|
146
|
+
slower: "var(--su-duration-slower)"
|
|
147
|
+
},
|
|
148
|
+
transitionTimingFunction: {
|
|
149
|
+
standard: "var(--su-ease-standard)",
|
|
150
|
+
decelerate: "var(--su-ease-decelerate)",
|
|
151
|
+
accelerate: "var(--su-ease-accelerate)"
|
|
152
|
+
},
|
|
153
|
+
radius: {
|
|
154
|
+
DEFAULT: "var(--su-radius-sm)",
|
|
155
|
+
sm: "var(--su-radius-sm)",
|
|
156
|
+
md: "var(--su-radius-md)",
|
|
157
|
+
lg: "var(--su-radius-lg)",
|
|
158
|
+
xl: "var(--su-radius-xl)",
|
|
159
|
+
full: "var(--su-radius-full)"
|
|
160
|
+
},
|
|
161
|
+
boxShadow: {
|
|
162
|
+
sm: "var(--su-shadow-sm)",
|
|
163
|
+
md: "var(--su-shadow-md)",
|
|
164
|
+
lg: "var(--su-shadow-lg)",
|
|
165
|
+
xl: "var(--su-shadow-xl)",
|
|
166
|
+
glow: "var(--su-shadow-glow)"
|
|
167
|
+
},
|
|
168
|
+
zIndex: {
|
|
169
|
+
base: "var(--su-z-base)",
|
|
170
|
+
dropdown: "var(--su-z-dropdown)",
|
|
171
|
+
sticky: "var(--su-z-sticky)",
|
|
172
|
+
fixed: "var(--su-z-fixed)",
|
|
173
|
+
modalBackdrop: "var(--su-z-modal-backdrop)",
|
|
174
|
+
modal: "var(--su-z-modal)",
|
|
175
|
+
popover: "var(--su-z-popover)",
|
|
176
|
+
tooltip: "var(--su-z-tooltip)",
|
|
177
|
+
toast: "var(--su-z-toast)"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
rules: [
|
|
181
|
+
[/^z-(base|dropdown|sticky|fixed|modal-backdrop|modal|popover|tooltip|toast)$/, (m) => ({ "z-index": `var(--su-z-${m[1]})` })],
|
|
182
|
+
[/^h-control-(sm|md|lg)$/, (m) => ({ height: `var(--su-control-h-${m[1]})` })],
|
|
183
|
+
[/^h-row$/, () => ({ height: "var(--su-row-h)" })]
|
|
184
|
+
],
|
|
185
|
+
preflights: options.preflight === false ? [] : [{ getCSS: () => `${cssVarsForTheme(state)}${brandCss}` }]
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
export { presetSolidUI as default, presetSolidUI };
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@wrikka/theme",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"description": "Design tokens, theme presets, and the UnoCSS configuration behind @wrikka/ui",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"src/styles/tokens.css",
|
|
14
|
+
"src/styles/theme.css",
|
|
15
|
+
"src/styles/markdown.css",
|
|
16
|
+
"src/styles/tokens.dtcg.json",
|
|
17
|
+
"uno.config.ts",
|
|
18
|
+
"tokens.json",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/index.mjs",
|
|
24
|
+
"types": "./dist/index.d.mts"
|
|
25
|
+
},
|
|
26
|
+
"./preset": {
|
|
27
|
+
"import": "./dist/preset.mjs",
|
|
28
|
+
"types": "./dist/preset.d.mts"
|
|
29
|
+
},
|
|
30
|
+
"./uno": "./uno.config.ts",
|
|
31
|
+
"./styles/*": "./src/styles/*"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsdown",
|
|
35
|
+
"dev": "tsdown --watch",
|
|
36
|
+
"typecheck": "bun check -p . --no-script",
|
|
37
|
+
"lint": "biome check src",
|
|
38
|
+
"format": "biome format --write src",
|
|
39
|
+
"test": "vitest run --passWithNoTests",
|
|
40
|
+
"gen:tokens": "bun scripts/export-tokens-dtcg.ts",
|
|
41
|
+
"check:tokens": "bun scripts/check-tokens.ts"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"unocss": ">=66.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"tsdown": "^0.23.0",
|
|
48
|
+
"typescript": "^7.0.2",
|
|
49
|
+
"unocss": "^66.10.4",
|
|
50
|
+
"vitest": "^5.0.1"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* Prose styles for the Markdown renderer. Pair with the `markdown-body` class. */
|
|
2
|
+
|
|
3
|
+
.markdown-body {
|
|
4
|
+
line-height: 1.7;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.markdown-body :first-child {
|
|
8
|
+
margin-top: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.markdown-body h1,
|
|
12
|
+
.markdown-body h2,
|
|
13
|
+
.markdown-body h3,
|
|
14
|
+
.markdown-body h4,
|
|
15
|
+
.markdown-body h5,
|
|
16
|
+
.markdown-body h6 {
|
|
17
|
+
margin-top: 2rem;
|
|
18
|
+
margin-bottom: 0.75rem;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
letter-spacing: -0.025em;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.markdown-body h1 {
|
|
24
|
+
font-size: 1.75rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.markdown-body h2 {
|
|
28
|
+
font-size: 1.35rem;
|
|
29
|
+
border-bottom: 1px solid var(--su-border);
|
|
30
|
+
padding-bottom: 0.35rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.markdown-body h3 {
|
|
34
|
+
font-size: 1.15rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.markdown-body p {
|
|
38
|
+
margin: 0 0 1rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.markdown-body ul,
|
|
42
|
+
.markdown-body ol {
|
|
43
|
+
margin: 0 0 1rem;
|
|
44
|
+
padding-left: 1.5rem;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.markdown-body li {
|
|
48
|
+
margin: 0.25rem 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.markdown-body a {
|
|
52
|
+
color: var(--su-primary);
|
|
53
|
+
text-decoration: underline;
|
|
54
|
+
text-underline-offset: 0.2em;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.markdown-body code {
|
|
58
|
+
font-size: 0.85em;
|
|
59
|
+
background: var(--su-muted);
|
|
60
|
+
padding: 0.15rem 0.35rem;
|
|
61
|
+
border-radius: 0.25rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.markdown-body pre {
|
|
65
|
+
background: var(--su-surface);
|
|
66
|
+
border: 1px solid var(--su-border);
|
|
67
|
+
border-radius: var(--su-radius);
|
|
68
|
+
padding: 1rem;
|
|
69
|
+
margin: 0 0 1rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.markdown-body pre code {
|
|
73
|
+
background: transparent;
|
|
74
|
+
padding: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.markdown-body blockquote {
|
|
78
|
+
margin: 0 0 1rem;
|
|
79
|
+
padding-left: 1rem;
|
|
80
|
+
border-left: 3px solid var(--su-border);
|
|
81
|
+
color: var(--su-muted-foreground);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Anchor targets clear a sticky top nav. */
|
|
85
|
+
.markdown-body [id] {
|
|
86
|
+
scroll-margin-top: 4.5rem;
|
|
87
|
+
}
|