Skip to content

Commit

Permalink
refactor: media queries
Browse files Browse the repository at this point in the history
  • Loading branch information
lxndrblz committed Feb 12, 2022
1 parent 9d78804 commit 13383f6
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 40 deletions.
9 changes: 9 additions & 0 deletions assets/scss/modules/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@
@content;
}
}

@mixin desktop_and_print {
@include desktop {
@content;
}
@include print {
@content;
}
}
2 changes: 1 addition & 1 deletion assets/scss/partials/components/_archive.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.archive {
width: 100%;

@media screen and (min-width: 961px), print {
@include desktop_and_print {
width: $content-width;
}

Expand Down
10 changes: 2 additions & 8 deletions assets/scss/partials/components/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,13 @@

&__sidebar {
display: none;
@include desktop{
display: inline-block;
}
@include print{
@include desktop_and_print{
display: inline-block;
}
}

&__base {
@include desktop{
display: none;
}
@include print{
@include desktop_and_print{
display: none;
}
}
Expand Down
14 changes: 7 additions & 7 deletions assets/scss/partials/components/_portfolio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
padding-bottom: 0px;
padding-top: 48px;

@media screen and (min-width: 961px), print {
@include desktop_and_print {
padding: 48px;
}

Expand Down Expand Up @@ -58,7 +58,7 @@
padding: 32px 32px 0px 32px;
max-width: inherit;

@media screen and (min-width: 961px), print {
@include desktop_and_print {
width: 60%;
object-fit: contain;
max-width: none;
Expand All @@ -69,15 +69,15 @@
}

&--left {
@media screen and (min-width: 961px), print {
@include desktop_and_print {
margin-right: auto;
margin-left: 0;
border-bottom-left-radius: 0.5em;
}
}

&--right {
@media screen and (min-width: 961px), print {
@include desktop_and_print {
margin-right: 0;
margin-left: auto;
border-bottom-right-radius: 0.5em;
Expand All @@ -89,7 +89,7 @@
&__description {
background-color: $accent;
padding: 32px;
@media screen and (min-width: 961px), print {
@include desktop_and_print {
padding: 48px;
box-shadow: $shadow;
background-color: $accent;
Expand All @@ -101,7 +101,7 @@
margin-top: -24px;
border-bottom: $border;

@media screen and (min-width: 961px), print {
@include desktop_and_print {
border-bottom: 0px;
width: 60%;
margin-top: -48px;
Expand All @@ -111,7 +111,7 @@
}

&--right {
@media screen and (min-width: 961px), print {
@include desktop_and_print {
margin-left: auto;
}
}
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/partials/components/_post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
&-wrapper {
width: 100%;

@media screen and (min-width: 961px), print {
@include desktop_and_print {
width: $content-width;
}
}
Expand Down
6 changes: 3 additions & 3 deletions assets/scss/partials/components/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
background-size: cover;
background-color: var(--bg-color);

@media screen and (min-width: 961px), print {
@include desktop_and_print {
border-right: 1px solid $primary-lighter;
z-index: 3;
height: 100vh;
Expand All @@ -22,13 +22,13 @@
&-wrapper {
width: 100%;

@media screen and (min-width: 961px), print {
@include desktop_and_print {
width: $sidebar-width;
}
}

&__content {
@media screen and (min-width: 961px), print {
@include desktop_and_print {
display: flex;
flex-direction: column;
flex-grow: 1;
Expand Down
23 changes: 4 additions & 19 deletions assets/scss/partials/layout/_header.scss
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
.header {
width: $content-width;
width: 100%;
position: fixed;
right: 0;
z-index: 3;
background-color: $accent;
}

@media screen and (min-width: 961px), print {
.header {
@include desktop {
border-bottom: $border;
}
}
@media screen and (max-width: 960px) {
.header {
width: 100%;
}
}

@media (min-width: 1921px) {
.header {
position: fixed;
width: $content-width;
}
}

@media print {
.header {
@include print {
display: none;
}
}
}
2 changes: 1 addition & 1 deletion assets/scss/partials/layout/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
}

@media screen and (min-width: 961px), print {
@include desktop_and_print {
.nav {
display: flex;
justify-content: space-between;
Expand Down

0 comments on commit 13383f6

Please sign in to comment.