Skip to content

Commit

Permalink
Merge pull request #205 from unix/page
Browse files Browse the repository at this point in the history
fix(page): fix page width too large at md breakpoint
  • Loading branch information
unix authored May 13, 2020
2 parents da723aa + 24ce127 commit 8c20be9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 50 deletions.
8 changes: 1 addition & 7 deletions components/page/__tests__/__snapshots__/child.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ exports[`PageChild should work with child component 1`] = `
max-width: 100vw;
min-height: 100vh;
margin: 0 auto;
padding: 0 16pt;
box-sizing: border-box;
position: relative;
}
@media only screen and (max-width: 650px) {
section {
max-width: 90vw;
min-height: -webkit-fill-available;
}
}
</style></section>"
`;
40 changes: 5 additions & 35 deletions components/page/__tests__/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,10 @@ exports[`Page should render correctly 1`] = `
max-width: 100vw;
min-height: 100vh;
margin: 0 auto;
padding: 0 16pt;
box-sizing: border-box;
position: relative;
}
@media only screen and (max-width: 650px) {
section {
max-width: 90vw;
min-height: -webkit-fill-available;
}
}
</style></section>"
`;
Expand All @@ -37,16 +31,10 @@ exports[`Page should work with different size 1`] = `
max-width: 100vw;
min-height: 100vh;
margin: 0 auto;
padding: 0 16pt;
box-sizing: border-box;
position: relative;
}
@media only screen and (max-width: 650px) {
section {
max-width: 90vw;
min-height: -webkit-fill-available;
}
}
</style></section><section><main class=\\"\\"><style>
main {
width: 100%;
Expand All @@ -58,16 +46,10 @@ exports[`Page should work with different size 1`] = `
max-width: 100vw;
min-height: 100vh;
margin: 0 auto;
padding: 0 16pt;
box-sizing: border-box;
position: relative;
}
@media only screen and (max-width: 650px) {
section {
max-width: 90vw;
min-height: -webkit-fill-available;
}
}
</style></section><section><main class=\\"\\"><style>
main {
width: 100%;
Expand All @@ -79,16 +61,10 @@ exports[`Page should work with different size 1`] = `
max-width: 100vw;
min-height: 100vh;
margin: 0 auto;
padding: 0 16pt;
box-sizing: border-box;
position: relative;
}
@media only screen and (max-width: 650px) {
section {
max-width: 90vw;
min-height: -webkit-fill-available;
}
}
</style></section><section><main class=\\"\\"><style>
main {
width: 100%;
Expand All @@ -100,15 +76,9 @@ exports[`Page should work with different size 1`] = `
max-width: 100vw;
min-height: 100vh;
margin: 0 auto;
padding: 0 16pt;
box-sizing: border-box;
position: relative;
}
@media only screen and (max-width: 650px) {
section {
max-width: 90vw;
min-height: -webkit-fill-available;
}
}
</style></section></div>"
`;
8 changes: 1 addition & 7 deletions components/page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,10 @@ const Page: React.FC<React.PropsWithChildren<NoteProps>> = ({
max-width: 100vw;
min-height: 100vh;
margin: 0 auto;
padding: 0 ${theme.layout.gap};
box-sizing: border-box;
position: relative;
}
@media only screen and (max-width: ${theme.layout.breakpointMobile}) {
section {
max-width: 90vw;
min-height: -webkit-fill-available;
}
}
`}</style>
</section>
)
Expand Down
3 changes: 2 additions & 1 deletion lib/components/displays/mock-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const MockPage: React.FC<React.PropsWithChildren<Props>> = ({
section {
position: fixed;
width: 100vw;
height: 100vw;
height: 100vh;
background-color: ${theme.palette.background};
z-index: 5000;
top: -5000px;
Expand All @@ -42,6 +42,7 @@ const MockPage: React.FC<React.PropsWithChildren<Props>> = ({
.active {
top: 0;
left: 0;
bottom: 0;
display: block;
}
`}</style>
Expand Down

0 comments on commit 8c20be9

Please sign in to comment.