@@ -12,52 +12,36 @@ const StyledLink = styled(Interactive.A, {
1212 textDecorationColor : '$green' ,
1313 textDecorationThickness : 'from-font' ,
1414
15+ // padding used to provide offset for boxShadow focus styles,
16+ // margin undoes padding for page layout so boxShadow works like outline
17+ padding : '2px 3px' ,
18+ margin : '-2px -3px' ,
19+ // this is the main reason to use boxShadow instead of outline for focus styles,
20+ // with outline can only have square corners,
21+ // with boxShadow can use borderRadius to soften the corners
22+ borderRadius : '3px' ,
23+
1524 '&.hover' : {
1625 textDecorationColor : '$green' ,
1726 textDecorationStyle : 'solid' ,
1827 } ,
1928 '&.mouseActive' : {
29+ color : '$green' ,
2030 textDecorationColor : '$green' ,
2131 textDecorationStyle : 'solid' ,
22- color : '$green' ,
2332 } ,
2433 '&.touchActive' : {
34+ color : '$blue' ,
2535 textDecorationColor : '$blue' ,
2636 textDecorationStyle : 'solid' ,
27- color : '$blue' ,
2837 } ,
2938 '&.keyActive' : {
39+ color : '$purple' ,
3040 textDecorationColor : '$purple' ,
3141 textDecorationStyle : 'solid' ,
32- color : '$purple' ,
33- } ,
34- variants : {
35- focus : {
36- outline : {
37- '&.focusFromKey' : {
38- outline : '2px solid $colors$purple' ,
39- outlineOffset : '2px' ,
40- } ,
41- } ,
42- boxShadow : {
43- // padding used to provide offset for boxShadow
44- // margin undoes padding for page layout so boxShadow works like outline
45- padding : '2px 3px' ,
46- margin : '-2px -3px' ,
47-
48- // this is the main reason to use boxShadow instead of outline
49- // with outline can only have square corners,
50- // with boxShadow can use borderRadius to soften the corners
51- borderRadius : '3px' ,
52-
53- '&.focusFromKey' : {
54- boxShadow : '0 0 0 2px $colors$purple' ,
55- } ,
56- } ,
57- } ,
5842 } ,
59- defaultVariants : {
60- focus : 'boxShadow ' ,
43+ '&.focusFromKey' : {
44+ boxShadow : '0 0 0 2px $colors$purple ' ,
6145 } ,
6246} ) ;
6347
0 commit comments