Skip to content

Commit

Permalink
Prevent structural FOUC
Browse files Browse the repository at this point in the history
  • Loading branch information
qwtel committed Sep 29, 2016
1 parent aad8799 commit 3211332
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
4 changes: 4 additions & 0 deletions _sass/hydejack/_base-essential.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
}
}

body {
border-left: 0.5rem solid #e8e8e8;
}

.sr-only {
// will be properly styled in the non-essential part
display: none;
Expand Down
2 changes: 1 addition & 1 deletion _sass/hydejack/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/

.content {
padding-top: 4rem;
padding-bottom: 4rem;
}

@media (min-width: 48em) {
.content {
padding-top: 4rem;
max-width: 38rem;
margin-left: 20rem;
margin-right: 2rem;
Expand Down
12 changes: 3 additions & 9 deletions _sass/hydejack/_drawer.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// Use larg desktop styles for mobile as well when the JS "drawer" is active
.drawer {
padding-left: 0.5rem;

/* Use larg desktop styles for mobile as well when the JS "drawer" is active */
> .sidebar {
position: fixed;
bottom: 0;
top: 0;
left: -17.5rem;
width: 18rem;
will-change: transform;
/*box-shadow: 0.25rem 0 0.5rem rgba(0, 0, 0, 0.15)*/
margin-left: 0;
}

> .backdrop {
Expand All @@ -33,15 +31,11 @@
pointer-events: all;
}
}

> .menu {
left: 0.5rem;
}
}

@media (min-width: 48em) {
// Disable drawer positiioning on larger screens (already done via JS, but just to be sure)
.sidebar {
/* Disable drawer positiioning on larger screens (already done via JS, but just to be sure) */
-webkit-transform: translate3d(0,0,0)!important;
-ms-transform: translate3d(0,0,0)!important;
transform: translate3d(0,0,0)!important;
Expand Down
7 changes: 2 additions & 5 deletions _sass/hydejack/_menu.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
.menu {
display: block;
position: absolute;
top: 0;
left: 0;
display: inline-block;
padding: 1.25rem 1rem ;
color: #9a9a9a;
z-index: 2;
border-bottom: none;
}

@media (min-width: 48em) {
Expand Down
2 changes: 2 additions & 0 deletions _sass/hydejack/_sidebar-essential.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
background-position: center center;
min-height: 640px; // fallback
min-height: 100vh;
margin-left: -0.5rem;

/* Sidebar links */
a {
Expand Down Expand Up @@ -64,5 +65,6 @@
left: 0;
bottom: 0;
width: 18rem;
margin-left: 0;
}
}

0 comments on commit 3211332

Please sign in to comment.