Skip to content

Commit

Permalink
Move stylesheets for header from _global.sccss to _header.scss (#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
KitaitiMakoto authored Apr 14, 2020
1 parent 8ba0c17 commit c217e5e
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 87 deletions.
87 changes: 0 additions & 87 deletions assets/themes/default/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -490,93 +490,6 @@ figure {

/// Small screens
@media screen and (max-width: 600px) {
@keyframes menuOpening {
from {
transform: scaleX(0);
transform-origin: left;
opacity: 0;
}
to {
transform: scaleX(1);
transform-origin: left;
opacity: 1;
}
}

body > header {
flex-direction: column;

nav#menu {
display: inline-flex;
z-index: 21;
}

#content {
display: none;
appearance: none;
text-align: center;
z-index: 20;
}
}

body > header:focus-within #content, #content.show {
position: fixed;
display: flex;
flex-direction: column;
justify-content: flex-start;

top: 0;
left: 0;
width: 100%;
height: 100%;
box-sizing: border-box;

animation: 0.2s menuOpening;

&::before {
content: "";
position: absolute;
transform: skewX(-10deg);
top: 0;
left: -20%;
width: 100%;
height: 100%;

z-index: -10;

background: $primary;
}

> nav {
flex-direction: column;
align-items: flex-start;

a {
display: flex;
flex-direction: row;
align-items: center;
margin: 0;
padding: 1rem 1.5rem;
color: $background;
font-size: 1.4em;
font-weight: 300;

&.title { font-size: 1.8em; }

> *:first-child { width: 3rem; }
> img:first-child { height: 3rem; }
> *:last-child { margin-left: 1rem; }
> nav hr {
display: block;
margin: 0;
width: 100%;
border: solid $background 0.1rem;
}
.mobile-label { display: initial; }
}
}
}

main .article-meta {
> *, .comments {
margin: 0 5%;
Expand Down
90 changes: 90 additions & 0 deletions assets/themes/default/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,96 @@ body > header {
}
}

/// Small screens
@media screen and (max-width: 600px) {
@keyframes menuOpening {
from {
transform: scaleX(0);
transform-origin: left;
opacity: 0;
}
to {
transform: scaleX(1);
transform-origin: left;
opacity: 1;
}
}

body > header {
flex-direction: column;

nav#menu {
display: inline-flex;
z-index: 21;
}

#content {
display: none;
appearance: none;
text-align: center;
z-index: 20;
}
}

body > header:focus-within #content, #content.show {
position: fixed;
display: flex;
flex-direction: column;
justify-content: flex-start;

top: 0;
left: 0;
width: 100%;
height: 100%;
box-sizing: border-box;

animation: 0.2s menuOpening;

&::before {
content: "";
position: absolute;
transform: skewX(-10deg);
top: 0;
left: -20%;
width: 100%;
height: 100%;

z-index: -10;

background: $primary;
}

> nav {
flex-direction: column;
align-items: flex-start;

a {
display: flex;
flex-direction: row;
align-items: center;
margin: 0;
padding: 1rem 1.5rem;
color: $background;
font-size: 1.4em;
font-weight: 300;

&.title { font-size: 1.8em; }

> *:first-child { width: 3rem; }
> img:first-child { height: 3rem; }
> *:last-child { margin-left: 1rem; }
> nav hr {
display: block;
margin: 0;
width: 100%;
border: solid $background 0.1rem;
}
.mobile-label { display: initial; }
}
}
}
}

/* Only enable label animations on large screens */
@media screen and (min-width: 600px) {
header nav a {
Expand Down

0 comments on commit c217e5e

Please sign in to comment.