Skip to content

Commit 4d51659

Browse files
committed
Update css sticky hover bug demo
1 parent cfdddf0 commit 4d51659

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

demo/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { StateLog } from './demos/StateLog';
22
import { LinksAndButtons } from './demos/LinksAndButtons';
33
import { ShowOn } from './demos/ShowOn';
4-
import { FormElements } from './demos/FormElements';
54
import { CssStickyHoverBug } from './demos/CssStickyHoverBug';
5+
import { FormElements } from './demos/FormElements';
66
import { StressTest } from './demos/StressTest';
77
import { styled } from './stitches.config';
88
import { GitHubIconLink } from './ui/GitHubIconLink';
@@ -53,8 +53,8 @@ export const App = () => {
5353
<StateLog />
5454
<LinksAndButtons />
5555
<ShowOn />
56-
<FormElements />
5756
<CssStickyHoverBug />
57+
<FormElements />
5858
<StressTest />
5959
</AppContainer>
6060
);

demo/src/demos/CssStickyHoverBug.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import { Link } from '../ui/Link';
55
import { styled } from '../stitches.config';
66

77
const PseudoClassButton = styled('button', {
8-
display: 'block',
8+
height: '100%',
99
padding: '8px 20px',
10-
marginTop: '18px',
1110
textAlign: 'center',
1211
backgroundColor: '$formElementsBackground',
1312
border: '1px solid',
@@ -24,9 +23,8 @@ const PseudoClassButton = styled('button', {
2423
});
2524

2625
const InteractiveButton = styled(Interactive.Button, {
27-
display: 'block',
26+
height: '100%',
2827
padding: '8px 20px',
29-
marginTop: '18px',
3028
textAlign: 'center',
3129
backgroundColor: '$formElementsBackground',
3230
border: '1px solid',
@@ -46,9 +44,13 @@ const InteractiveButton = styled(Interactive.Button, {
4644
});
4745

4846
const ButtonsContainer = styled('div', {
49-
display: 'flex',
50-
gap: '15px',
5147
marginTop: '15px',
48+
display: 'grid',
49+
gridTemplateColumns: 'auto auto',
50+
gridTemplateRows: 'auto auto',
51+
gridAutoFlow: 'column',
52+
gridColumnGap: '18px',
53+
gridRowGap: '18px',
5254
});
5355

5456
export const CssStickyHoverBug: React.VFC = () => {
@@ -65,18 +67,18 @@ export const CssStickyHoverBug: React.VFC = () => {
6567
until you tap someplace else on the screen.
6668
</p>
6769
<ButtonsContainer>
70+
<p>
71+
Button styled with pseudo-classes, <code>:hover</code> is green,{' '}
72+
<code>:active</code> is red.
73+
</p>
6874
<div>
69-
<p>
70-
Button styled with pseudo-classes, <code>:hover</code> is green,{' '}
71-
<code>:active</code> is red.
72-
</p>
7375
<PseudoClassButton>Pseudo-class Button</PseudoClassButton>
7476
</div>
77+
<p>
78+
Button styled with React Interactive, <code>.hover</code> is green,{' '}
79+
<code>.active</code> is red.
80+
</p>
7581
<div>
76-
<p>
77-
Button styled with React Interactive, <code>.hover</code> is green,{' '}
78-
<code>.active</code> is red.
79-
</p>
8082
<InteractiveButton
8183
// useExtendedTouchActive to match css :active functionality
8284
// which stays in the :active state as long a the touch point is on the screen,

0 commit comments

Comments
 (0)