Skip to content

Commit 29b81d6

Browse files
committed
fix(forMedia): gap in breakpoints
1 parent c9d5542 commit 29b81d6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

components/button/Button.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const styles = {
1313
padding: 1rem;
1414
font-size: 0.85rem;
1515
16-
${forMedia('tablet', `
17-
max-width: 320px;
18-
`)}
16+
${forMedia('tablet', `max-width: 320px;`)}
1917
`,
2018
};
2119

components/mixins.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export const gutter = (n: number = 1) => `
6060
`;
6161

6262
const mqForMedia = (media: Media) => (
63-
media === 'phone'
64-
? `(max-width: ${breakpoints[media]})`
65-
: `(min-width: ${breakpoints[media]})`
63+
media === 'phone' && `(max-width: ${breakpoints.phone})` ||
64+
media === 'tablet' && `(min-width: ${breakpoints.phone})` ||
65+
`(min-width: ${breakpoints[media]})`
6666
);
6767

6868
export const forMedia = (media: Media, css: string) => `

pages/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ export const twoColumnSectionStyles = [
2828
flex: 1;
2929
}
3030
31+
margin: 0 auto;
32+
max-width: ${breakpoints.phone};
33+
3134
`,
3235
forMedia('tablet', `
3336
display: flex;
3437
align-items: center;
3538
flex-direction: row;
3639
justify-content: center;
3740
38-
margin: 0 auto;
3941
max-width: ${breakpoints.tablet};
4042
`),
4143
];

0 commit comments

Comments
 (0)