Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change body padding for mobile #498

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions site/src/App.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import './globals';

button {
color: inherit;
}
Expand All @@ -18,6 +20,10 @@ button {
overflow-x: hidden;
background-color: var(--background);
box-sizing: border-box;

@media (max-width: $mobile-cutoff) {
padding: 20px 24px;
}
}

.ppc-btn {
Expand Down
6 changes: 4 additions & 2 deletions site/src/component/AppHeader/AppHeader.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@import '../../globals';

#peterportal-logo {
width: auto;
height: 32px;
@media (min-width: 800px) {
@media (min-width: $mobile-cutoff) {
height: 36px;
}
}
Expand Down Expand Up @@ -76,7 +78,7 @@
width: fit-content;
}

@media only screen and (max-width: 800px) {
@media only screen and (max-width: $mobile-cutoff) {
.beta {
display: none;
}
Expand Down
4 changes: 3 additions & 1 deletion site/src/component/ChangelogModal/ChangelogModal.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../globals';

.changelog-modal {
.modal-content {
border: none;
Expand Down Expand Up @@ -33,7 +35,7 @@
font-size: 32px;
}

@media only screen and (max-width: 800px) {
@media only screen and (max-width: $mobile-cutoff) {
.modal-img {
max-width: 90vw;
max-height: 50vh;
Expand Down
4 changes: 3 additions & 1 deletion site/src/component/ReviewForm/ReviewForm.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../globals';

[data-theme='dark'] {
.review-form {
.form-control,
Expand Down Expand Up @@ -130,7 +132,7 @@
gap: 14px;
}

@media only screen and (max-width: 800px) {
@media only screen and (max-width: $mobile-cutoff) {
.review-form {
height: 80vh;
overflow-y: auto;
Expand Down
2 changes: 1 addition & 1 deletion site/src/component/SearchModule/SearchModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const SearchModule: FC<SearchModuleProps> = ({ index }) => {

return (
<div className="search-module">
<Form.Group className="mb-3">
<Form.Group>
<InputGroup>
<InputGroup.Prepend>
<InputGroup.Text>
Expand Down
4 changes: 3 additions & 1 deletion site/src/component/SearchPopup/SearchPopup.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../globals';

[data-theme='dark'] {
.search-popup {
.dropdown,
Expand Down Expand Up @@ -33,13 +35,13 @@

.search-popup {
background-color: var(--overlay1);
padding: 3rem;
margin-left: 3vw;
height: 85vh;
overflow-y: auto;
border-radius: var(--border-radius);
width: 576px;
max-width: 40vw;
@include card-padding;
}

.search-popup-header {
Expand Down
4 changes: 3 additions & 1 deletion site/src/component/SideBar/Sidebar.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../globals';

.sidebar {
position: fixed;
width: 300px;
Expand Down Expand Up @@ -178,7 +180,7 @@
}
}

@media only screen and (max-width: 800px) {
@media only screen and (max-width: $mobile-cutoff) {
display: none;
}
}
Expand Down
4 changes: 3 additions & 1 deletion site/src/component/SideInfo/SideInfo.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
@import '../../globals';

.side-info {
width: 40vw;
height: fit-content;
max-height: 85vh;
background-color: var(--overlay1);
border-radius: var(--border-radius);
padding: 3rem;
position: sticky;
top: 0;
overflow-y: auto;
@include card-padding;
}

.side-info-data {
Expand Down
8 changes: 8 additions & 0 deletions site/src/globals.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$mobile-cutoff: 800px;

@mixin card-padding {
padding: 32px 36px;
@media (max-width: $mobile-cutoff) {
padding: 16px 20px;
}
}
4 changes: 3 additions & 1 deletion site/src/pages/CoursePage/CoursePage.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../globals';

.course-page {
display: flex;
}
Expand All @@ -10,8 +12,8 @@
max-width: 45vw;
background-color: var(--overlay1);
border-radius: var(--border-radius);
padding: 3rem;
margin-bottom: 3vh;
@include card-padding;
}

.twemoji {
Expand Down
4 changes: 3 additions & 1 deletion site/src/pages/ProfessorPage/ProfessorPage.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../globals';

.professor-page {
display: flex;
}
Expand All @@ -10,8 +12,8 @@
max-width: 45vw;
background-color: var(--overlay1);
border-radius: var(--border-radius);
padding: 3rem;
margin-bottom: 3vh;
@include card-padding;
}

.twemoji {
Expand Down
4 changes: 3 additions & 1 deletion site/src/pages/RoadmapPage/Year.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../globals';

[data-theme='dark'] {
.year-settings-btn:hover,
.year-settings-btn:focus,
Expand Down Expand Up @@ -140,7 +142,7 @@
}
}

@media only screen and (max-width: 800px) {
@media only screen and (max-width: $mobile-cutoff) {
.year-accordion-content {
flex-direction: column;
}
Expand Down
10 changes: 8 additions & 2 deletions site/src/pages/SearchPage/SearchPage.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../globals';

#content-container {
display: flex;
flex-grow: 1;
Expand All @@ -16,16 +18,20 @@
}

.search-hit-container {
margin-top: 2vh; // use margin instead of padding so the scroll bar isn't offset/above the first hit item
margin-top: 8px; // use margin instead of padding so the scroll bar isn't offset/above the first hit item
padding-top: 0;

.hit-item:last-child {
margin-bottom: 0; // so scroll bar doesn't extend past the last hit item
}

@media (max-width: $mobile-cutoff) {
margin-top: 4px;
}
}
}

@media only screen and (max-width: 800px) {
@media only screen and (max-width: $mobile-cutoff) {
#content-container {
#search-list {
width: 100%;
Expand Down
Loading