Skip to content

Commit a865f0d

Browse files
committed
chore: update styles in playground
1 parent e81c69a commit a865f0d

File tree

7 files changed

+83
-29
lines changed

7 files changed

+83
-29
lines changed

playground/components/asyncStep.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const Container = styled('div')`
3232
`;
3333

3434
const P = styled('p')`
35-
color: white;
35+
color: var(--text);
3636
`;
3737

3838
const AsyncStep: React.FC<Props> = React.memo(({ number }) => {

playground/components/footer.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,31 @@ import { useWizard } from '../../dist';
55
import { Button } from '../modules/common';
66

77
const Actions = styled('div')`
8-
display: grid;
8+
display: flex;
99
justify-content: center;
1010
margin: 1rem 0;
11-
grid-template-columns: min-content min-content;
1211
gap: 1rem;
12+
flex-direction: row;
1313
`;
1414

1515
const Info = styled('div')`
1616
display: flex;
1717
justify-content: center;
18-
gap: 1rem;
18+
flex-direction: column;
19+
gap: 0;
20+
21+
& > p {
22+
margin: 0.25rem 0;
23+
}
24+
25+
@media screen and (min-width: 600px) {
26+
flex-direction: row;
27+
gap: 1rem;
28+
29+
& > p {
30+
margin: initial;
31+
}
32+
}
1933
`;
2034

2135
const Footer: React.FC = React.memo(() => {

playground/components/step.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Container = styled('div')`
2121
`;
2222

2323
const P = styled('p')`
24-
color: white;
24+
color: var(--text);
2525
`;
2626

2727
const Step: React.FC<Props> = React.memo(({ number, withCallback = true }) => {

playground/modules/common/button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Container = styled('button')`
1212
border: 1px solid var(--purple);
1313
padding: 0.7rem 1.75rem;
1414
border-radius: 6px;
15-
color: white;
15+
color: var(--text);
1616
font-size: 1.1rem;
1717
font-weight: 700;
1818
background-color: var(--dark);
@@ -27,6 +27,7 @@ const Container = styled('button')`
2727
&:disabled {
2828
opacity: 0.4;
2929
background-image: initial;
30+
cursor: initial;
3031
}
3132
`;
3233

playground/modules/common/page.tsx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const Container = styled('main')`
1414
display: flex;
1515
justify-content: center;
1616
background: var(--dark);
17+
overflow: hidden;
1718
`;
1819

1920
const Wrapper = styled('div')`
@@ -27,29 +28,35 @@ const Body = styled('div')`
2728
const Description = styled('div')`
2829
font-size: 1.1rem;
2930
font-weight: 200;
31+
line-height: 1.5rem;
3032
`;
3133

3234
const Divider = styled('div')`
3335
height: 2px;
34-
width: 7%;
36+
width: 15%;
3537
background-image: linear-gradient(48.66deg, var(--purple), var(--blue));
36-
margin: 2.5rem 0;
38+
margin: 2.5rem auto;
3739
display: flex;
40+
41+
@media screen and (min-width: 800px) {
42+
max-width: 7%;
43+
}
3844
`;
3945

4046
const TopBar = styled('header')`
4147
position: sticky;
4248
top: 0;
4349
left: 0;
4450
right: 0;
45-
padding: 1.5rem 1.75rem;
51+
padding: 1.75rem 0;
4652
display: flex;
4753
justify-content: space-between;
4854
align-items: center;
49-
margin-bottom: 4rem;
55+
margin-bottom: 5rem;
5056
background-color: var(--nav);
5157
backdrop-filter: blur(20px);
5258
z-index: 1000;
59+
width: 100%;
5360
`;
5461

5562
const Logo = styled('img')`
@@ -62,11 +69,19 @@ const GithubLogo = styled('img')`
6269
`;
6370

6471
const MaxWidth = styled('div')`
65-
max-width: 53rem;
72+
width: 100%;
6673
padding: 0 2rem;
6774
margin: 0 auto;
6875
justify-content: space-between;
69-
width: 100%;
76+
77+
@media screen and (min-width: 800px) {
78+
max-width: 53rem;
79+
padding: 0 2rem;
80+
}
81+
`;
82+
83+
const H1 = styled('h1')`
84+
font-size: 2.25rem;
7085
`;
7186

7287
const Page = ({ title, description, children }: Props) => {
@@ -77,6 +92,7 @@ const Page = ({ title, description, children }: Props) => {
7792
<MaxWidth
7893
style={{
7994
display: 'flex',
95+
alignItems: 'center',
8096
}}
8197
>
8298
<Logo src={logoPath} />
@@ -90,7 +106,7 @@ const Page = ({ title, description, children }: Props) => {
90106
</MaxWidth>
91107
</TopBar>
92108
<MaxWidth>
93-
<h1>{title}</h1>
109+
<H1>{title}</H1>
94110
<Description>{description}</Description>
95111
<Divider />
96112
<Body>{children}</Body>

playground/modules/common/style.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const GlobalStyle = createGlobalStyles`
1111
--blue: #08D8F4;
1212
--code:#260949;
1313
--step:#170231;
14+
--text: #cccccc;
15+
}
16+
17+
* {
18+
box-sizing: border-box;
1419
}
1520
1621
html {
@@ -31,7 +36,7 @@ const GlobalStyle = createGlobalStyles`
3136
body {
3237
font-family: 'Inter', Helvetica, sans-serif;
3338
text-rendering: optimizeLegibility;
34-
color: white;
39+
color: var(--text);
3540
}
3641
3742
i {
@@ -44,7 +49,7 @@ const GlobalStyle = createGlobalStyles`
4449
border-radius: 2px;
4550
font-family: 'Fira Code', monospace;
4651
font-size: 0.95rem;
47-
padding: 0.75rem 0.35rem;
52+
padding: 0.75rem 1rem;
4853
}
4954
`;
5055

playground/modules/wizard/wizard.tsx

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { styled } from 'goober';
1+
import { css, styled } from 'goober';
22
import * as React from 'react';
33

44
import { Wizard } from '../../../dist';
55
import { AnimatedStep, AsyncStep, Footer, Step } from '../../components';
66

7-
const Grid = styled('section')`
8-
display: grid;
9-
grid-template-columns: repeat(1, 1fr);
7+
const Container = styled('section')`
8+
display: flex;
9+
flex-direction: column;
1010
width: 100%;
1111
`;
1212

@@ -21,27 +21,45 @@ const Title = styled('h2')`
2121
}
2222
`;
2323

24-
const Item = styled('div')`
25-
display: grid;
26-
grid-template-rows: min-content;
24+
const Item = styled('div')<{ showDivider: boolean }>`
25+
display: flex;
26+
flex-direction: column;
2727
2828
&::after {
29-
content: '';
3029
margin: 3rem 0 2rem;
30+
content: '';
3131
background-image: linear-gradient(48.66deg, var(--purple), var(--blue));
3232
width: 100%;
3333
position: relative;
34-
height: 1px;
34+
height: ${({ showDivider }) => (showDivider ? '1px' : 0)};
3535
}
36+
37+
${({ showDivider }) =>
38+
showDivider
39+
? `
40+
&::after {
41+
margin: 3rem 0 2rem;
42+
content: '';
43+
background-image: linear-gradient(
44+
48.66deg,
45+
var(--purple),
46+
var(--blue)
47+
);
48+
width: 100%;
49+
position: relative;
50+
height: 1px;
51+
}
52+
`
53+
: ''}
3654
`;
3755

3856
const WizardModule = () => {
3957
return (
40-
<Grid>
58+
<Container>
4159
<Title>
4260
Simple wizard <span>mix of async and sync steps</span>
4361
</Title>
44-
<Item>
62+
<Item showDivider>
4563
<Wizard footer={<Footer />}>
4664
<AsyncStep number={1} />
4765
<Step number={2} />
@@ -51,9 +69,9 @@ const WizardModule = () => {
5169
</Item>
5270

5371
<Title>
54-
Animated wizard <span>animations by framer motion</span>
72+
Animated wizard <span>animation by framer motion</span>
5573
</Title>
56-
<Item>
74+
<Item showDivider={false}>
5775
<Wizard footer={<Footer />}>
5876
<AnimatedStep>
5977
<Step number={1} withCallback={false} />
@@ -69,7 +87,7 @@ const WizardModule = () => {
6987
</AnimatedStep>
7088
</Wizard>
7189
</Item>
72-
</Grid>
90+
</Container>
7391
);
7492
};
7593

0 commit comments

Comments
 (0)