@@ -36,90 +36,6 @@ export interface GeneratedTheme {
3636 documentation : string ;
3737}
3838
39- /**
40- * Generate spacing tokens using base-8 system
41- */
42- function generateSpacingTokens ( ) : DesignToken [ ] {
43- const spacingScale = [
44- { name : 'xs' , value : '4px' } ,
45- { name : 'sm' , value : '8px' } ,
46- { name : 'md' , value : '16px' } ,
47- { name : 'lg' , value : '24px' } ,
48- { name : 'xl' , value : '32px' } ,
49- { name : '2xl' , value : '48px' }
50- ] ;
51-
52- return spacingScale . map ( ( { name, value } ) => ( {
53- name : `spacing-${ name } ` ,
54- value,
55- category : 'spacing' ,
56- description : `Spacing ${ name } - ${ value } `
57- } ) ) ;
58- }
59-
60- /**
61- * Generate typography tokens
62- */
63- function generateTypographyTokens ( ) : DesignToken [ ] {
64- return [
65- {
66- name : 'font-family-base' ,
67- value : '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif' ,
68- category : 'typography' ,
69- description : 'Base font family for body text'
70- } ,
71- {
72- name : 'font-family-heading' ,
73- value : '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif' ,
74- category : 'typography' ,
75- description : 'Font family for headings'
76- } ,
77- {
78- name : 'font-family-mono' ,
79- value : '"SF Mono", "Monaco", "Consolas", monospace' ,
80- category : 'typography' ,
81- description : 'Monospace font family for code'
82- } ,
83- { name : 'font-size-xs' , value : '12px' , category : 'typography' , description : 'Extra small font size' } ,
84- { name : 'font-size-sm' , value : '14px' , category : 'typography' , description : 'Small font size' } ,
85- { name : 'font-size-md' , value : '16px' , category : 'typography' , description : 'Medium font size (base)' } ,
86- { name : 'font-size-lg' , value : '18px' , category : 'typography' , description : 'Large font size' } ,
87- { name : 'font-size-xl' , value : '20px' , category : 'typography' , description : 'Extra large font size' } ,
88- { name : 'font-size-2xl' , value : '24px' , category : 'typography' , description : '2X large font size' } ,
89- { name : 'font-size-3xl' , value : '32px' , category : 'typography' , description : '3X large font size' } ,
90- { name : 'font-weight-normal' , value : '400' , category : 'typography' , description : 'Normal font weight' } ,
91- { name : 'font-weight-medium' , value : '500' , category : 'typography' , description : 'Medium font weight' } ,
92- { name : 'font-weight-semibold' , value : '600' , category : 'typography' , description : 'Semibold font weight' } ,
93- { name : 'font-weight-bold' , value : '700' , category : 'typography' , description : 'Bold font weight' } ,
94- { name : 'line-height-tight' , value : '1.25' , category : 'typography' , description : 'Tight line height for headings' } ,
95- { name : 'line-height-normal' , value : '1.5' , category : 'typography' , description : 'Normal line height for body text' } ,
96- { name : 'line-height-relaxed' , value : '1.75' , category : 'typography' , description : 'Relaxed line height for long-form content' }
97- ] ;
98- }
99-
100- /**
101- * Generate border tokens
102- */
103- function generateBorderTokens ( ) : DesignToken [ ] {
104- return [
105- { name : 'border-radius-sm' , value : '4px' , category : 'border' , description : 'Small border radius' } ,
106- { name : 'border-radius-md' , value : '8px' , category : 'border' , description : 'Medium border radius' } ,
107- { name : 'border-radius-lg' , value : '12px' , category : 'border' , description : 'Large border radius' } ,
108- { name : 'border-radius-full' , value : '9999px' , category : 'border' , description : 'Full border radius for circular elements' }
109- ] ;
110- }
111-
112- /**
113- * Generate shadow tokens
114- */
115- function generateShadowTokens ( ) : DesignToken [ ] {
116- return [
117- { name : 'shadow-sm' , value : '0 1px 2px 0 rgba(0, 0, 0, 0.05)' , category : 'shadow' , description : 'Small shadow for subtle elevation' } ,
118- { name : 'shadow-md' , value : '0 4px 6px -1px rgba(0, 0, 0, 0.1)' , category : 'shadow' , description : 'Medium shadow for cards and panels' } ,
119- { name : 'shadow-lg' , value : '0 10px 15px -3px rgba(0, 0, 0, 0.1)' , category : 'shadow' , description : 'Large shadow for modals and popovers' }
120- ] ;
121- }
122-
12339/**
12440 * Generate Optics HSL color tokens from brand colors
12541 * Each color family gets h/s/l base values that drive the scale system
@@ -148,20 +64,23 @@ function generateColorTokens(brandColors: BrandColors): DesignToken[] {
14864
14965 tokens . push ( {
15066 name : `op-color-${ familyName } -h` ,
67+ cssVar : `--op-color-${ familyName } -h` ,
15168 value : String ( hsl . h ) ,
15269 category : 'color' ,
15370 description : `${ familyName } color hue (HSL) - drives all ${ familyName } scale tokens`
15471 } ) ;
155-
72+
15673 tokens . push ( {
15774 name : `op-color-${ familyName } -s` ,
75+ cssVar : `--op-color-${ familyName } -s` ,
15876 value : `${ hsl . s } %` ,
15977 category : 'color' ,
16078 description : `${ familyName } color saturation (HSL)`
16179 } ) ;
162-
80+
16381 tokens . push ( {
16482 name : `op-color-${ familyName } -l` ,
83+ cssVar : `--op-color-${ familyName } -l` ,
16584 value : `${ hsl . l } %` ,
16685 category : 'color' ,
16786 description : `${ familyName } color lightness (HSL)`
0 commit comments