Circular Pagination

By Rafi

F6
#
How do I use This?

Pagination with nice buttons for good touch target.

HTML
<ul class="pagination pagination-circular" role="navigation" aria-label="Pagination">
  <li class="disabled">« <span class="show-for-sr">Previous page</span></li>
  <li class="current"><span class="show-for-sr">You're on page</span> 1</li>
  <li><a href="#" aria-label="Page 2">2</a></li>
  <li><a href="#" aria-label="Page 3">3</a></li>
  <li><a href="#" aria-label="Page 4">4</a></li>
  <li><a href="#" aria-label="Page 5">5</a></li>
  <li><a href="#" aria-label="Next page">» <span class="show-for-sr">Next page</span></a></li>
</ul>

$pagination-circular-size: 18px; // controls font and circle size
$pagination-circular-color: $primary-color;
$pagination-circular-disabled-color: $medium-gray;
$pagination-circular-border-thickness: 1px;


.pagination-circular li.current {
  border: $pagination-circular-border-thickness solid $pagination-circular-color;
  border-radius: 5000px;
  padding: 0.285em 0.8em;
  font-size: $pagination-circular-size;
}

.pagination-circular li.disabled {
  border: $pagination-circular-border-thickness solid $pagination-circular-disabled-color;
  padding: 0.285em 0.8em;
  border-radius: 5000px;
  font-size: $pagination-circular-size;
}

.pagination-circular a {
  border-radius: 5000px;
  padding: 0.285em 0.8em;
  border: $pagination-circular-border-thickness solid $pagination-circular-color;
  font-size: $pagination-circular-size;
}

.pagination-circular li:not(.disabled):hover a {
  background: $pagination-circular-color;
  color: $white;
}

.pagination-circular li a {
  transition: background 0.15s ease-in, color 0.15s ease-in;
}


.pagination-circular li.current {
  border: 1px solid #1779ba;
  border-radius: 5000px;
  padding: 0.285em 0.8em;
  font-size: 18px;
}

.pagination-circular li.disabled {
  border: 1px solid #cacaca;
  padding: 0.285em 0.8em;
  border-radius: 5000px;
  font-size: 18px;
}

.pagination-circular a {
  border-radius: 5000px;
  padding: 0.285em 0.8em;
  border: 1px solid #1779ba;
  font-size: 18px;
}

.pagination-circular li:not(.disabled):hover a {
  background: #1779ba;
  color: #fefefe;
}

.pagination-circular li a {
  transition: background 0.15s ease-in, color 0.15s ease-in;
}

JS