_next-previous.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /* Next/Previous navigation */
  2. // Singular navigation
  3. .post-navigation {
  4. margin: calc(3 * 1rem) 0;
  5. @include media(tablet) {
  6. margin: calc(3 * 1rem) auto;
  7. max-width: calc(8 * (100vw / 12) - 28px);
  8. }
  9. @include media(desktop) {
  10. max-width: 100%;
  11. }
  12. .nav-links {
  13. margin: 0 $size__spacing-unit;
  14. max-width: 100%;
  15. display: flex;
  16. flex-direction: column;
  17. @include media(tablet) {
  18. margin: 0;
  19. }
  20. @include media(desktop) {
  21. flex-direction: row;
  22. margin: 0 auto;
  23. max-width: $size__site-desktop-content;
  24. }
  25. a {
  26. .meta-nav {
  27. color: $color__text-light;
  28. user-select: none;
  29. &:before,
  30. &:after {
  31. display: none;
  32. content: "—";
  33. width: 2em;
  34. color: $color__text-light;
  35. height: 1em;
  36. }
  37. }
  38. .post-title {
  39. hyphens: auto;
  40. }
  41. &:hover {
  42. color: $color__link-hover;
  43. }
  44. }
  45. .nav-previous,
  46. .nav-next {
  47. @include media(desktop) {
  48. min-width: calc(50% - 2 * #{$size__spacing-unit});
  49. }
  50. }
  51. .nav-previous {
  52. order: 2;
  53. @include media(desktop) {
  54. order: 1;
  55. }
  56. + .nav-next {
  57. margin-bottom: $size__spacing-unit;
  58. }
  59. .meta-nav {
  60. &:before {
  61. display: inline;
  62. }
  63. }
  64. }
  65. .nav-next {
  66. order: 1;
  67. @include media(desktop) {
  68. order: 2;
  69. padding-left: $size__spacing-unit;
  70. }
  71. .meta-nav {
  72. &:after {
  73. display: inline;
  74. }
  75. }
  76. }
  77. }
  78. }
  79. // Index/archive navigation
  80. .pagination {
  81. .nav-links {
  82. display: flex;
  83. flex-wrap: wrap;
  84. justify-content: center;
  85. padding: 0 calc(.5 * #{$size__spacing-unit});
  86. & > * {
  87. padding: calc(.5 * #{$size__spacing-unit});
  88. &.dots,
  89. &.prev {
  90. padding-left: 0;
  91. }
  92. &.dots,
  93. &.next {
  94. padding-right: 0;
  95. }
  96. }
  97. a:focus {
  98. text-decoration: underline;
  99. outline-offset: -1px;
  100. &.prev,
  101. &.next {
  102. text-decoration: none;
  103. .nav-prev-text,
  104. .nav-next-text {
  105. text-decoration: underline;
  106. }
  107. }
  108. }
  109. .nav-next-text,
  110. .nav-prev-text {
  111. display: none;
  112. }
  113. @include media(tablet) {
  114. margin-left: $size__site-margins;
  115. margin-right: $size__site-margins;
  116. padding: 0;
  117. .prev,
  118. .next {
  119. & > * {
  120. display: inline-block;
  121. vertical-align: text-bottom;
  122. }
  123. }
  124. & > * {
  125. padding: $size__spacing-unit;
  126. }
  127. }
  128. }
  129. }
  130. // Comments navigation
  131. .comment-navigation {
  132. .nav-links {
  133. display: flex;
  134. flex-direction: row;
  135. }
  136. .nav-previous,
  137. .nav-next {
  138. min-width: 50%;
  139. width: 100%;
  140. font-family: $font__heading;
  141. font-weight: bold;
  142. .secondary-text {
  143. display: none;
  144. @include media(tablet) {
  145. display: inline;
  146. }
  147. }
  148. svg {
  149. vertical-align: middle;
  150. position: relative;
  151. margin: 0 -0.35em;
  152. top: -1px;
  153. }
  154. }
  155. .nav-next {
  156. text-align: right;
  157. }
  158. }