_next-previous.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /* Next/Previous navigation */
  2. // Singular navigation
  3. .post-navigation {
  4. margin: calc(3 * #{ $size__spacing-unit}) $size__spacing-unit $size__spacing-unit;
  5. @include media(tablet) {
  6. margin: calc(3 * 1rem) auto calc(1rem / 2);
  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-main;
  22. user-select: none;
  23. &:before,
  24. &:after {
  25. display: none;
  26. content: "—";
  27. width: 2em;
  28. color: $color__text-main;
  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. @include media(tablet) {
  100. margin: 32px auto;
  101. max-width: calc(6*(100vw/12) - 28px);
  102. }
  103. padding: 0;
  104. .prev,
  105. .next {
  106. & > * {
  107. display: inline-block;
  108. vertical-align: text-bottom;
  109. }
  110. }
  111. & > * {
  112. padding: $size__spacing-unit;
  113. }
  114. }
  115. }
  116. }
  117. // Comments navigation
  118. .comment-navigation {
  119. .nav-links {
  120. display: flex;
  121. flex-direction: row;
  122. }
  123. .nav-previous,
  124. .nav-next {
  125. min-width: 50%;
  126. width: 100%;
  127. font-family: $font__heading;
  128. font-weight: bold;
  129. .secondary-text {
  130. display: none;
  131. @include media(tablet) {
  132. display: inline;
  133. }
  134. }
  135. svg {
  136. vertical-align: middle;
  137. position: relative;
  138. margin: 0 -0.35em;
  139. top: -1px;
  140. }
  141. }
  142. .nav-next {
  143. margin-left: auto;
  144. }
  145. }