Skip to content

Commit cfdddf0

Browse files
committed
Update LinksAndButtons demo
1 parent eea14c8 commit cfdddf0

File tree

3 files changed

+45
-5
lines changed

3 files changed

+45
-5
lines changed

demo/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { StateLog } from './demos/StateLog';
2-
import { Links } from './demos/Links';
2+
import { LinksAndButtons } from './demos/LinksAndButtons';
33
import { ShowOn } from './demos/ShowOn';
44
import { FormElements } from './demos/FormElements';
55
import { CssStickyHoverBug } from './demos/CssStickyHoverBug';
@@ -51,7 +51,7 @@ export const App = () => {
5151
navigation too!
5252
</DemoContainer>
5353
<StateLog />
54-
<Links />
54+
<LinksAndButtons />
5555
<ShowOn />
5656
<FormElements />
5757
<CssStickyHoverBug />

demo/src/demos/FormElements.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const Button = styled(Interactive.Button, {
189189
'&.touchActive': {
190190
color: '$blue',
191191
borderColor: '$blue',
192-
boxShadow: '0 0 0 1px $colors$blue, 2px 3px 4px 0px rgba(0, 0, 0, 0.38)',
192+
boxShadow: '0 0 0 1px $colors$blue',
193193
},
194194
'&.keyActive': {
195195
color: '$purple',
Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,49 @@ const P = styled('p', {
4343
marginTop: '10px',
4444
});
4545

46-
export const Links: React.VFC = () => {
46+
const Button = styled(Interactive.Button, {
47+
display: 'block',
48+
padding: '10px 26px',
49+
marginTop: '16px',
50+
fontFamily: '$mono',
51+
textAlign: 'center',
52+
backgroundColor: '$formElementsBackground',
53+
border: '1px solid',
54+
borderRadius: '1000px',
55+
56+
'&.hover': {
57+
borderColor: '$green',
58+
boxShadow: '2px 3px 4px 0px rgba(0, 0, 0, 0.38)',
59+
},
60+
// focusFromKey styles are overridden by active styles (below), but not hover styles (above)
61+
'&.focusFromKey': {
62+
borderColor: '$purple',
63+
boxShadow: '0 0 0 1px $colors$purple, 2px 3px 4px 0px rgba(0, 0, 0, 0.38)',
64+
},
65+
'&.mouseActive': {
66+
color: '$green',
67+
borderColor: '$green',
68+
boxShadow: '1px 2px 3px 0px rgba(0, 0, 0, 0.38)',
69+
},
70+
'&.touchActive': {
71+
color: '$blue',
72+
borderColor: '$blue',
73+
boxShadow: '0 0 0 1px $colors$blue',
74+
},
75+
'&.keyActive': {
76+
color: '$purple',
77+
borderColor: '$purple',
78+
boxShadow: '0 0 0 1px $colors$purple, 1px 2px 3px 0px rgba(0, 0, 0, 0.38)',
79+
},
80+
'&.disabled': {
81+
opacity: 0.5,
82+
},
83+
});
84+
85+
export const LinksAndButtons: React.VFC = () => {
4786
return (
4887
<DemoContainer id="links">
49-
<DemoHeading>Links</DemoHeading>
88+
<DemoHeading>Links and Buttons</DemoHeading>
5089
<AnchorLink href="#">
5190
Anchor tag link – <code>as="a" href="#"</code>
5291
</AnchorLink>
@@ -60,6 +99,7 @@ export const Links: React.VFC = () => {
6099
</Link>{' '}
61100
that appears in the middle of some text.
62101
</P>
102+
<Button>as="button"</Button>
63103
</DemoContainer>
64104
);
65105
};

0 commit comments

Comments
 (0)