77
88import { useState } from 'react' ;
99import * as stylex from '@stylexjs/stylex' ;
10-
11- const styles = stylex . create ( {
12- container : {
13- maxWidth : 1100 ,
14- marginInline : 'auto' ,
15- paddingBlock : 80 ,
16- paddingInline : 32 ,
17- fontFamily :
18- "Noto Sans, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'" ,
19- color : '#1a1a1a' ,
20- minHeight : '100vh' ,
21- } ,
22- header : { marginBottom : 64 } ,
23- title : {
24- fontFamily : 'Playfair Display, serif' ,
25- fontSize : 64 ,
26- fontWeight : 700 ,
27- lineHeight : 0.9 ,
28- margin : 0 ,
29- } ,
30- subtitle : {
31- fontFamily :
32- "Noto Sans, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'" ,
33- fontSize : 26 ,
34- marginTop : 12 ,
35- } ,
36- section : { marginBottom : 64 } ,
37- sectionTitle : {
38- fontFamily : 'Playfair Display, serif' ,
39- fontSize : 40 ,
40- fontWeight : 700 ,
41- marginBottom : 16 ,
42- } ,
43- list : {
44- listStylePosition : 'inside' ,
45- listStyleType : 'decimal' ,
46- paddingLeft : 0 ,
47- fontSize : 20 ,
48- lineHeight : 1.6 ,
49- } ,
50- listItem : { marginBottom : 12 } ,
51- link : {
52- color : '#f47238' ,
53- fontWeight : 700 ,
54- textDecorationLine : 'none' ,
55- ':hover' : { color : '#ffad48' } ,
56- } ,
57- codeBlock : {
58- backgroundColor : '#1b1b1b' ,
59- color : '#ffad48' ,
60- padding : 16 ,
61- borderRadius : 8 ,
62- fontFamily :
63- 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace' ,
64- fontSize : 20 ,
65- display : 'flex' ,
66- alignItems : 'center' ,
67- gap : 8 ,
68- marginTop : 16 ,
69- } ,
70- codePrompt : { color : '#f47238' } ,
71- code : { flexGrow : 1 } ,
72- copyButton : {
73- backgroundColor : 'transparent' ,
74- color : '#ffad48' ,
75- borderWidth : 0 ,
76- borderRadius : 4 ,
77- paddingBlock : 4 ,
78- paddingInline : 12 ,
79- cursor : 'pointer' ,
80- fontSize : 16 ,
81- fontWeight : 700 ,
82- ':hover' : { backgroundColor : 'rgba(255,255,255,0.1)' } ,
83- } ,
84- } ) ;
10+ import { Button } from 'shared-ui' ;
11+ import { tokens } from 'shared-ui/tokens.stylex' ;
8512
8613export const Welcome = ( ) => {
8714 return (
@@ -152,6 +79,9 @@ export const Welcome = () => {
15279 .
15380 </ p >
15481 </ section >
82+ < section >
83+ < Button xstyle = { styles . btn } > button from shared-ui</ Button >
84+ </ section >
15585 </ main >
15686 </ div >
15787 ) ;
@@ -173,3 +103,96 @@ const Copy = ({ textToCopy }: { textToCopy: string }) => {
173103 </ button >
174104 ) ;
175105} ;
106+
107+ const opacity = ( color : string , percentage : number ) =>
108+ `color-mix(in oklab, ${ color } ${ percentage } %, transparent)` ;
109+
110+ const styles = stylex . create ( {
111+ container : {
112+ maxWidth : 1100 ,
113+ marginInline : 'auto' ,
114+ paddingBlock : 80 ,
115+ paddingInline : 32 ,
116+ fontFamily :
117+ "Noto Sans, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'" ,
118+ color : '#1a1a1a' ,
119+ minHeight : '100vh' ,
120+ } ,
121+ header : { marginBottom : 64 } ,
122+ title : {
123+ fontFamily : 'Playfair Display, serif' ,
124+ fontSize : 64 ,
125+ fontWeight : 700 ,
126+ lineHeight : 0.9 ,
127+ margin : 0 ,
128+ } ,
129+ subtitle : {
130+ fontFamily :
131+ "Noto Sans, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'" ,
132+ fontSize : 26 ,
133+ marginTop : 12 ,
134+ } ,
135+ section : { marginBottom : 64 } ,
136+ sectionTitle : {
137+ fontFamily : 'Playfair Display, serif' ,
138+ fontSize : 40 ,
139+ fontWeight : 700 ,
140+ marginBottom : 16 ,
141+ } ,
142+ list : {
143+ listStylePosition : 'inside' ,
144+ listStyleType : 'decimal' ,
145+ paddingLeft : 0 ,
146+ fontSize : 20 ,
147+ lineHeight : 1.6 ,
148+ } ,
149+ listItem : { marginBottom : 12 } ,
150+ link : {
151+ color : '#f47238' ,
152+ fontWeight : 700 ,
153+ textDecorationLine : 'none' ,
154+ ':hover' : { color : '#ffad48' } ,
155+ } ,
156+ codeBlock : {
157+ backgroundColor : '#1b1b1b' ,
158+ color : '#ffad48' ,
159+ padding : 16 ,
160+ borderRadius : 8 ,
161+ fontFamily :
162+ 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace' ,
163+ fontSize : 20 ,
164+ display : 'flex' ,
165+ alignItems : 'center' ,
166+ gap : 8 ,
167+ marginTop : 16 ,
168+ } ,
169+ codePrompt : { color : '#f47238' } ,
170+ code : { flexGrow : 1 } ,
171+ copyButton : {
172+ backgroundColor : 'transparent' ,
173+ color : '#ffad48' ,
174+ borderWidth : 0 ,
175+ borderRadius : 4 ,
176+ paddingBlock : 4 ,
177+ paddingInline : 12 ,
178+ cursor : 'pointer' ,
179+ fontSize : 16 ,
180+ fontWeight : 700 ,
181+ ':hover' : { backgroundColor : 'rgba(255,255,255,0.1)' } ,
182+ } ,
183+ btn : {
184+ backgroundColor : {
185+ default : opacity ( tokens . primaryColor , 50 ) ,
186+ ':hover' : opacity ( tokens . primaryColor , 95 ) ,
187+ } ,
188+ transform : {
189+ default : null ,
190+ ':active' : 'scale(0.97)' ,
191+ } ,
192+ transitionProperty : 'transform' ,
193+ transitionDuration : {
194+ default : '0.3s' ,
195+ ':active' : '0.05s' ,
196+ } ,
197+ } ,
198+ } ) ;
0 commit comments