pager.pcss.css

Same filename in this branch
  1. 9 core/themes/olivero/css/components/pager.pcss.css
Same filename in other branches
  1. 8.9.x core/themes/claro/css/components/pager.pcss.css
  2. 10 core/themes/olivero/css/components/pager.pcss.css
  3. 10 core/themes/claro/css/components/pager.pcss.css
  4. 11.x core/themes/olivero/css/components/pager.pcss.css
  5. 11.x core/themes/claro/css/components/pager.pcss.css

Styles for Claro's Pagination.

File

core/themes/claro/css/components/pager.pcss.css

View source
  1. /**
  2. * @file
  3. * Styles for Claro's Pagination.
  4. */
  5. @import "../base/variables.pcss.css";
  6. :root {
  7. /**
  8. * Pager.
  9. */
  10. --pager-size: 2rem; /* --space-m × 2 */
  11. --pager-border-width: 0.125rem; /* 2px */
  12. --pager-fg-color: var(--color-gray-800);
  13. --pager-bg-color: var(--color-white);
  14. --pager--hover-bg-color: var(--color-bgblue-active);
  15. --pager--focus-bg-color: var(--color-focus);
  16. --pager--active-fg-color: var(--color-white);
  17. --pager--active-bg-color: var(--color-absolutezero);
  18. --pager-border-radius--action: var(--pager-border-width);
  19. }
  20. .pager {
  21. margin-top: var(--space-m);
  22. margin-bottom: var(--space-m);
  23. }
  24. .pager__items {
  25. display: flex;
  26. flex-wrap: wrap;
  27. align-items: flex-end;
  28. justify-content: center;
  29. margin: var(--space-m) 0; /* LTR */
  30. list-style: none;
  31. text-align: center;
  32. font-weight: bold;
  33. }
  34. [dir="rtl"] .pager__items {
  35. margin: var(--space-m) 0;
  36. }
  37. .pager__item {
  38. display: inline-block;
  39. margin-right: calc(var(--space-xs) / 2);
  40. margin-left: calc(var(--space-xs) / 2);
  41. vertical-align: top;
  42. }
  43. .pager__link,
  44. .pager__item--current {
  45. display: flex;
  46. align-items: center;
  47. justify-content: center;
  48. box-sizing: border-box;
  49. min-width: var(--pager-size);
  50. height: var(--pager-size);
  51. padding-right: var(--space-xs);
  52. padding-left: var(--space-xs);
  53. text-decoration: none;
  54. color: var(--pager-fg-color);
  55. border-radius: var(--space-m); /* Pager size ÷ 2 */
  56. background: var(--pager-bg-color); /* Make sure that the text is visible on dark background. */
  57. line-height: 1;
  58. }
  59. .pager__link:hover,
  60. .pager__link:focus,
  61. .pager__link:active {
  62. text-decoration: none;
  63. }
  64. .pager__link:hover,
  65. .pager__link.is-active:hover {
  66. color: var(--pager-fg-color);
  67. background: var(--pager--hover-bg-color);
  68. }
  69. .pager__link--action-link {
  70. border-radius: var(--pager-border-radius--action);
  71. }
  72. /* Active number link. */
  73. .pager__link.is-active,
  74. .pager__item--current {
  75. color: var(--pager--active-fg-color);
  76. border: var(--pager-border-width) solid transparent;
  77. background: var(--pager--active-bg-color);
  78. }
  79. .pager__item--first .pager__link::before {
  80. background-image: url(../../images/icons/545560/pager-first.svg);
  81. }
  82. .pager__item--previous .pager__link::before {
  83. background-image: url(../../images/icons/545560/pager-prev.svg);
  84. }
  85. .pager__item--next .pager__link::after {
  86. background-image: url(../../images/icons/545560/pager-next.svg);
  87. }
  88. .pager__item--last .pager__link::after {
  89. background-image: url(../../images/icons/545560/pager-last.svg);
  90. }
  91. .pager__item--first .pager__link::before,
  92. .pager__item--previous .pager__link::before,
  93. .pager__item--next .pager__link::after,
  94. .pager__item--last .pager__link::after {
  95. position: relative;
  96. display: inline-block;
  97. width: 1rem;
  98. height: 1rem;
  99. content: "";
  100. background-repeat: no-repeat;
  101. background-position: center;
  102. }
  103. @media (forced-colors: active) {
  104. .pager__item--first .pager__link::before {
  105. mask-image: url(../../images/icons/545560/pager-first.svg);
  106. }
  107. .pager__item--previous .pager__link::before {
  108. mask-image: url(../../images/icons/545560/pager-prev.svg);
  109. }
  110. .pager__item--next .pager__link::after {
  111. mask-image: url(../../images/icons/545560/pager-next.svg);
  112. }
  113. .pager__item--last .pager__link::after {
  114. mask-image: url(../../images/icons/545560/pager-last.svg);
  115. }
  116. .pager__item--first .pager__link::before,
  117. .pager__item--previous .pager__link::before,
  118. .pager__item--next .pager__link::after,
  119. .pager__item--last .pager__link::after {
  120. background-color: linktext;
  121. background-image: none;
  122. mask-repeat: no-repeat;
  123. mask-position: center;
  124. }
  125. }
  126. [dir="rtl"] .pager__item--first .pager__link::before,
  127. [dir="rtl"] .pager__item--previous .pager__link::before,
  128. [dir="rtl"] .pager__item--next .pager__link::after,
  129. [dir="rtl"] .pager__item--last .pager__link::after {
  130. transform: scaleX(-1);
  131. }
  132. .pager__item--mini {
  133. margin-right: calc(var(--space-m) / 2);
  134. margin-left: calc(var(--space-m) / 2);
  135. }
  136. .pager__link--mini {
  137. border-radius: 50%;
  138. }
  139. /**
  140. * On the mini pager, remove margins for the previous and next icons.
  141. * Margins are not needed here as there is no accompanying text.
  142. */
  143. .pager__link--mini::before {
  144. margin-right: 0;
  145. margin-left: 0;
  146. }
  147. .pager__item-title--backwards {
  148. margin-left: 0.5rem; /* LTR */
  149. }
  150. [dir="rtl"] .pager__item-title--backwards {
  151. margin-right: 0.5rem;
  152. margin-left: 0;
  153. }
  154. .pager__item-title--forward {
  155. margin-right: 0.5rem; /* LTR */
  156. }
  157. [dir="rtl"] .pager__item-title--forward {
  158. margin-right: 0;
  159. margin-left: 0.5rem;
  160. }
  161. @media (-ms-high-contrast: active), (forced-colors: active) {
  162. .pager__item a:hover {
  163. text-decoration: underline;
  164. }
  165. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.