Skip to content

Commit

Permalink
update adaptive view
Browse files Browse the repository at this point in the history
  • Loading branch information
Inna-Mykytiuk committed Sep 4, 2023
1 parent 83bfc6e commit 47690d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/components/Container/Container.styled.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import styled from '@emotion/styled';

const breakpoints = {
xs: '320px',
s: '375px',
m: '768px',
l: '1440px',
};

const smallDeviceMediaQuery = `@media (max-width: ${breakpoints.m})`;
const smallDeviceMediaQuery = `@media (max-width: 768px)`;
const bigDeviceMediaQuery = '@media (max-width: 1280px)';

export const MainContainer = styled.div`
width: 100%;
max-width: 1280px;
margin: 0 auto;
padding: 0 20px;
${bigDeviceMediaQuery} {
padding: 0 10px;
max-width: 800px;
}
${smallDeviceMediaQuery} {
padding: 0 10px;
max-width: 380px;
Expand Down
9 changes: 8 additions & 1 deletion src/pages/Home.styled.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from '@emotion/styled';
const smallDeviceMediaQuery = '@media (max-width: 600px)';
const smallDeviceMediaQuery = '@media (max-width: 768px)';
const bigDeviceMediaQuery = '@media (max-width: 1280px)';

export const HomePage = styled.div`
width: 100%;
Expand All @@ -21,8 +22,14 @@ export const HomeContainer = styled.div`
width: 600px;
margin-left: auto;
${bigDeviceMediaQuery} {
width: 500px;
}
${smallDeviceMediaQuery} {
width: 320px;
align-items: center;
margin: 0;
}
`;

Expand Down

0 comments on commit 47690d8

Please sign in to comment.