_next-previous.scss 2.6 KB

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