_next-previous.scss 2.4 KB

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