@@ -3,7 +3,10 @@ import { createSignal } from 'solid-js'
33import { tokens } from './tokens'
44import type { ButtonVariant } from '../components/button'
55
6- const buttonVariantColors : Record < ButtonVariant , { bg : string ; hover : string ; active : string ; text : string ; border : string } > = {
6+ const buttonVariantColors : Record <
7+ ButtonVariant ,
8+ { bg : string ; hover : string ; active : string ; text : string ; border : string }
9+ > = {
710 primary : {
811 bg : tokens . colors . purple [ 500 ] ,
912 hover : tokens . colors . purple [ 600 ] ,
@@ -46,8 +49,8 @@ const buttonVariantColors: Record<ButtonVariant, { bg: string; hover: string; ac
4649 text : '#fff' ,
4750 border : tokens . colors . green [ 500 ] ,
4851 } ,
49- } ;
50- const stylesFactory = ( theme : 'light' | 'dark' = " dark" ) => {
52+ }
53+ const stylesFactory = ( theme : 'light' | 'dark' = ' dark' ) => {
5154 const { colors, font, size, alpha } = tokens
5255 const { fontFamily } = font
5356 const css = goober . css
@@ -240,22 +243,26 @@ const stylesFactory = (theme: 'light' | 'dark' = "dark") => {
240243 ` ,
241244 button : {
242245 base : css `
243- display : inline-flex;
244- align-items : center;
245- justify-content : center;
246- font-family : ${ tokens . font . fontFamily . sans } ;
247- font-size : 0.8rem ;
248- font-weight : 500 ;
249- border-radius : 0.2rem ;
250- padding : 0.2rem 0.6rem ;
251- cursor : pointer;
252- transition : background 0.2s , color 0.2s , border 0.2s , box-shadow 0.2s ;
253- outline : none;
254- border-width : 1px ;
255- border-style : solid;
256- ` ,
246+ display : inline-flex;
247+ align-items : center;
248+ justify-content : center;
249+ font-family : ${ tokens . font . fontFamily . sans } ;
250+ font-size : 0.8rem ;
251+ font-weight : 500 ;
252+ border-radius : 0.2rem ;
253+ padding : 0.2rem 0.6rem ;
254+ cursor : pointer;
255+ transition :
256+ background 0.2s ,
257+ color 0.2s ,
258+ border 0.2s ,
259+ box-shadow 0.2s ;
260+ outline : none;
261+ border-width : 1px ;
262+ border-style : solid;
263+ ` ,
257264 variant ( variant : ButtonVariant , outline ?: boolean , ghost ?: boolean ) {
258- const v = buttonVariantColors [ variant ] ;
265+ const v = buttonVariantColors [ variant ]
259266 if ( ghost ) {
260267 return goober . css `
261268 background : transparent;
@@ -267,7 +274,7 @@ const stylesFactory = (theme: 'light' | 'dark' = "dark") => {
267274 & : active {
268275 background : ${ tokens . colors . purple [ 200 ] } ;
269276 }
270- ` ;
277+ `
271278 }
272279 if ( outline ) {
273280 return goober . css `
@@ -282,7 +289,7 @@ const stylesFactory = (theme: 'light' | 'dark' = "dark") => {
282289 background : ${ tokens . colors . purple [ 200 ] } ;
283290 border-color : ${ v . active } ;
284291 }
285- ` ;
292+ `
286293 }
287294 // Default solid button
288295 return goober . css `
@@ -297,8 +304,8 @@ const stylesFactory = (theme: 'light' | 'dark' = "dark") => {
297304 background : ${ v . active } ;
298305 border-color : ${ v . active } ;
299306 }
300- ` ;
301- }
307+ `
308+ } ,
302309 } ,
303310 tag : {
304311 dot : ( color : keyof typeof tokens . colors ) => css `
0 commit comments