pager.pcss.css
Same filename in this branch
Same filename in other branches
Styles for Claro's Pagination.
File
-
core/
themes/ claro/ css/ components/ pager.pcss.css
View source
- /**
- * @file
- * Styles for Claro's Pagination.
- */
-
- @import "../base/variables.pcss.css";
-
- :root {
- /**
- * Pager.
- */
- --pager-size: 2rem; /* --space-m × 2 */
- --pager-border-width: 0.125rem; /* 2px */
- --pager-fg-color: var(--color-gray-800);
- --pager-bg-color: var(--color-white);
- --pager--hover-bg-color: var(--color-bgblue-active);
- --pager--focus-bg-color: var(--color-focus);
- --pager--active-fg-color: var(--color-white);
- --pager--active-bg-color: var(--color-absolutezero);
- --pager-border-radius--action: var(--pager-border-width);
- }
-
- .pager {
- margin-top: var(--space-m);
- margin-bottom: var(--space-m);
- }
-
- .pager__items {
- display: flex;
- flex-wrap: wrap;
- align-items: flex-end;
- justify-content: center;
- margin: var(--space-m) 0; /* LTR */
- list-style: none;
- text-align: center;
- font-weight: bold;
- }
- [dir="rtl"] .pager__items {
- margin: var(--space-m) 0;
- }
-
- .pager__item {
- display: inline-block;
- margin-right: calc(var(--space-xs) / 2);
- margin-left: calc(var(--space-xs) / 2);
- vertical-align: top;
- }
-
- .pager__link,
- .pager__item--current {
- display: flex;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- min-width: var(--pager-size);
- height: var(--pager-size);
- padding-right: var(--space-xs);
- padding-left: var(--space-xs);
- text-decoration: none;
- color: var(--pager-fg-color);
- border-radius: var(--space-m); /* Pager size ÷ 2 */
- background: var(--pager-bg-color); /* Make sure that the text is visible on dark background. */
- line-height: 1;
- }
- .pager__link:hover,
- .pager__link:focus,
- .pager__link:active {
- text-decoration: none;
- }
- .pager__link:hover,
- .pager__link.is-active:hover {
- color: var(--pager-fg-color);
- background: var(--pager--hover-bg-color);
- }
- .pager__link--action-link {
- border-radius: var(--pager-border-radius--action);
- }
- /* Active number link. */
- .pager__link.is-active,
- .pager__item--current {
- color: var(--pager--active-fg-color);
- border: var(--pager-border-width) solid transparent;
- background: var(--pager--active-bg-color);
- }
- .pager__item--first .pager__link::before {
- background-image: url(../../images/icons/545560/pager-first.svg);
- }
- .pager__item--previous .pager__link::before {
- background-image: url(../../images/icons/545560/pager-prev.svg);
- }
- .pager__item--next .pager__link::after {
- background-image: url(../../images/icons/545560/pager-next.svg);
- }
- .pager__item--last .pager__link::after {
- background-image: url(../../images/icons/545560/pager-last.svg);
- }
- .pager__item--first .pager__link::before,
- .pager__item--previous .pager__link::before,
- .pager__item--next .pager__link::after,
- .pager__item--last .pager__link::after {
- position: relative;
- display: inline-block;
- width: 1rem;
- height: 1rem;
- content: "";
- background-repeat: no-repeat;
- background-position: center;
- }
-
- @media (forced-colors: active) {
- .pager__item--first .pager__link::before {
- mask-image: url(../../images/icons/545560/pager-first.svg);
- }
- .pager__item--previous .pager__link::before {
- mask-image: url(../../images/icons/545560/pager-prev.svg);
- }
- .pager__item--next .pager__link::after {
- mask-image: url(../../images/icons/545560/pager-next.svg);
- }
- .pager__item--last .pager__link::after {
- mask-image: url(../../images/icons/545560/pager-last.svg);
- }
- .pager__item--first .pager__link::before,
- .pager__item--previous .pager__link::before,
- .pager__item--next .pager__link::after,
- .pager__item--last .pager__link::after {
- background-color: linktext;
- background-image: none;
- mask-repeat: no-repeat;
- mask-position: center;
- }
- }
-
- [dir="rtl"] .pager__item--first .pager__link::before,
- [dir="rtl"] .pager__item--previous .pager__link::before,
- [dir="rtl"] .pager__item--next .pager__link::after,
- [dir="rtl"] .pager__item--last .pager__link::after {
- transform: scaleX(-1);
- }
-
- .pager__item--mini {
- margin-right: calc(var(--space-m) / 2);
- margin-left: calc(var(--space-m) / 2);
- }
- .pager__link--mini {
- border-radius: 50%;
- }
-
- /**
- * On the mini pager, remove margins for the previous and next icons.
- * Margins are not needed here as there is no accompanying text.
- */
- .pager__link--mini::before {
- margin-right: 0;
- margin-left: 0;
- }
-
- .pager__item-title--backwards {
- margin-left: 0.5rem; /* LTR */
- }
- [dir="rtl"] .pager__item-title--backwards {
- margin-right: 0.5rem;
- margin-left: 0;
- }
-
- .pager__item-title--forward {
- margin-right: 0.5rem; /* LTR */
- }
- [dir="rtl"] .pager__item-title--forward {
- margin-right: 0;
- margin-left: 0.5rem;
- }
-
- @media (-ms-high-contrast: active), (forced-colors: active) {
- .pager__item a:hover {
- text-decoration: underline;
- }
- }
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.