_sidebar.scss 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. ///
  2. /// Hyperspace by HTML5 UP
  3. /// html5up.net | @ajlkn
  4. /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
  5. ///
  6. /* Sidebar */
  7. #sidebar {
  8. @include padding(2.5em, 2.5em);
  9. background: _palette(bg);
  10. cursor: default;
  11. height: 100vh;
  12. left: 0;
  13. overflow-x: hidden;
  14. overflow-y: auto;
  15. position: fixed;
  16. text-align: right;
  17. top: 0;
  18. width: _size(sidebar-width);
  19. z-index: _misc(z-index-base);
  20. > .inner {
  21. @include vendor('display', 'flex');
  22. @include vendor('flex-direction', 'column');
  23. @include vendor('justify-content', 'center');
  24. @include vendor('transform', 'translateY(0)');
  25. @include vendor('transition', (
  26. 'opacity #{_duration(activation)} ease',
  27. ));
  28. min-height: 100%;
  29. opacity: 1;
  30. width: 100%;
  31. body.is-ie & {
  32. height: 100%;
  33. }
  34. }
  35. nav {
  36. > ul {
  37. list-style: none;
  38. padding: 0;
  39. > li {
  40. @include vendor('transform', 'translateY(0)');
  41. @include vendor('transition', (
  42. 'opacity #{_duration(activation) * 0.15} ease',
  43. 'transform #{_duration(activation) * 0.75} ease'
  44. ));
  45. margin: 1.5em 0 0 0;
  46. opacity: 1;
  47. padding: 0;
  48. position: relative;
  49. &:first-child {
  50. margin: 0;
  51. }
  52. @for $i from 1 through _misc(max-sidebar-links) {
  53. &:nth-child(#{$i}) {
  54. @include vendor('transition-delay', '#{(_duration(activation) * 0.2 * $i) + (_duration(activation) * 0.25)}');
  55. }
  56. }
  57. }
  58. }
  59. a {
  60. @include vendor('transition', 'color #{_duration(transition)} ease');
  61. border: 0;
  62. color: _palette(fg-light);
  63. display: block;
  64. font-size: 0.6em;
  65. font-weight: _font(weight-bold);
  66. letter-spacing: _font(kerning-alt);
  67. line-height: 1.75;
  68. outline: 0;
  69. padding: 1.35em 0;
  70. position: relative;
  71. text-decoration: none;
  72. text-transform: uppercase;
  73. &:before,
  74. &:after {
  75. border-radius: 0.2em;
  76. bottom: 0;
  77. content: '';
  78. height: 0.2em;
  79. position: absolute;
  80. right: 0;
  81. width: 100%;
  82. }
  83. &:before {
  84. background: lighten(_palette(bg), 5);
  85. }
  86. &:after {
  87. @include vendor('background-image', 'linear-gradient(to right, #{_palette(accent1)}, #{_palette(accent3)})');
  88. @include vendor('transition', 'max-width #{_duration(transition)} ease');
  89. max-width: 0;
  90. }
  91. &:hover {
  92. color: _palette(fg);
  93. }
  94. &.active {
  95. color: _palette(fg-bold);
  96. &:after {
  97. max-width: 100%;
  98. }
  99. }
  100. }
  101. }
  102. body.is-loading & {
  103. > .inner {
  104. opacity: 0;
  105. }
  106. nav {
  107. ul {
  108. li {
  109. @include vendor('transform', 'translateY(2em)');
  110. opacity: 0;
  111. }
  112. }
  113. }
  114. }
  115. @include breakpoint(large) {
  116. height: _size(sidebar-height);
  117. left: 0;
  118. line-height: _size(sidebar-height);
  119. overflow: hidden;
  120. padding: 0;
  121. text-align: center;
  122. top: 0;
  123. width: 100%;
  124. > .inner {
  125. @include vendor('flex-direction', 'row');
  126. @include vendor('align-items', 'stretch');
  127. height: inherit;
  128. line-height: inherit;
  129. }
  130. nav {
  131. height: inherit;
  132. line-height: inherit;
  133. ul {
  134. @include vendor('display', 'flex');
  135. height: inherit;
  136. line-height: inherit;
  137. margin: 0;
  138. li {
  139. display: block;
  140. height: inherit;
  141. line-height: inherit;
  142. margin: 0 0 0 2em;
  143. padding: 0;
  144. }
  145. }
  146. a {
  147. height: inherit;
  148. line-height: inherit;
  149. padding: 0;
  150. &:after {
  151. background-image: none;
  152. background-color: _palette(accent3);
  153. }
  154. }
  155. }
  156. }
  157. @include breakpoint(small) {
  158. display: none;
  159. }
  160. }