Skip to content

Commit

Permalink
feat: .menu--vertical, fade-in-up animate
Browse files Browse the repository at this point in the history
  • Loading branch information
kitian616 committed Jul 23, 2018
1 parent 678a9ed commit 50727e2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 3 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

{%- if page.sidebar -%}
<script>
{%- include scripts/sidebar.js -%}
{%- include scripts/components/sidebar.js -%}
</script>
{%- endif -%}

Expand Down
10 changes: 10 additions & 0 deletions _sass/animate/_fade-in-up.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@include keyframes(fade-in-up) {
from {
opacity: 0;
@include transform(translateY(2rem));
}
to {
opacity: 1;
@include transform(translateY(0));
}
}
22 changes: 21 additions & 1 deletion _sass/common/components/_menu.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
@mixin menu-direction($direction: default) {
@if $direction == default {
$direction: 'horizontal';
}
@if $direction == 'vertical' {
@include flex-direction(column);
} @else {
@include flex-direction(row);
}
}

@mixin menu($horizontal-spacer: default, $horizontal-item-vertical-spacer: default, $wrap: default) {
@if $horizontal-spacer == default {
$horizontal-spacer: map-get($menu, horizontal-spacer);
Expand All @@ -10,7 +21,6 @@
}
@include flexbox();
@include flex-wrap($wrap);
@include align-items(center);
margin-top: 0;
margin-bottom: 0;
& > li {
Expand All @@ -28,6 +38,16 @@

.menu {
@include menu();
@include menu-direction();
@include align-items(center);
}

.menu--vertical {
@include menu-direction('vertical');
@include align-items(normal);
& > li {
margin-right: 0;
}
}

.menu--center {
Expand Down
2 changes: 1 addition & 1 deletion _sass/components/_article.content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
& > pre {
border-radius: 0;
display: block;
overflow: visible;
@include overflow(auto);
margin: 0;
&.lineno {
color: $text-color-l;
Expand Down
1 change: 1 addition & 0 deletions assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"common/components/toc",

"animate/fade-in",
"animate/fade-in-up",
"animate/fade-in-down",

"components/author-profile",
Expand Down

0 comments on commit 50727e2

Please sign in to comment.