Pagination with Pointed Buttons

By Rafi

F6
#
How do I use This?

Pagination with nice buttons for good touch target.

HTML
<ul class="pagination-pointed pagination text-center" role="navigation" aria-label="Pagination">
  <li class="pagination-previous disabled">Previous <span class="show-for-sr">page</span></li>
  <li class="current"><span class="show-for-sr">You're on page</span> 1</li>
  <li><a class="pagination-pointed-button" href="#" aria-label="Page 2">2</a></li>
  <li><a class="pagination-pointed-button" href="#" aria-label="Page 3">3</a></li>
  <li><a class="pagination-pointed-button" href="#" aria-label="Page 4">4</a></li>
  <li class="ellipsis" aria-hidden="true"></li>
  <li><a class="pagination-pointed-button" href="#" aria-label="Page 12">12</a></li>
  <li><a class="pagination-pointed-button" href="#" aria-label="Page 13">13</a></li>
  <li class="pagination-next"><a class="pagination-pointed-button" href="#" aria-label="Next page">Next <span class="show-for-sr">page</span></a></li>
</ul>

$white: #fff;
$pagination-primary-color: #2c3840;
$pagination-current-color: dodgerblue;
$pagination-radius: 4px;

.pagination-pointed {
  .pagination-pointed-button {
    position: relative;
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    border-radius: $pagination-radius;
    background-color: $pagination-primary-color;
    color: $white;
    outline: 0;
    text-decoration: none;
    transition: all 0.2s linear;

    &:hover {
      background-color: lighten($pagination-primary-color, 10%);
    }
  }

  .current {
    @extend .pagination-pointed-button;
    background: $pagination-current-color;

    &:hover {
      background-color: darken($pagination-current-color, 10%);
    }
  }

  .pagination-next a {
    border-radius: $pagination-radius 0 0 $pagination-radius;
    margin-right: 18px;

    &:hover::after {
      border-left: 17px solid lighten($pagination-primary-color, 10%);
    }

    &::after {
      content: "";
      position: absolute;
      top: 0;
      right: -18px;
      width: 0;
      height: 0;
      border-top: 17px solid transparent;
      border-bottom: 17px solid transparent;
      border-left: 17px solid $pagination-primary-color;
      transition: all 0.2s linear;
    }
  }

  .pagination-previous {
    @extend .pagination-pointed-button;
    border-radius: 0 $pagination-radius $pagination-radius 0;
    margin-left: 18px;

    &:hover::after {
      border-right: 17px solid lighten($pagination-primary-color, 10%);
    }

    &::before {
      content: ""; //removes the arrow
    }

    &::after {
      content: "";
      position: absolute;
      top: 0;
      left: -18px;
      width: 0;
      height: 0;
      border-bottom: 17px solid transparent;
      border-top: 17px solid transparent;
      border-right: 17px solid $pagination-primary-color;
      transition: all 0.2s linear;
    }
  }
}


.pagination-pointed .pagination-pointed-button, .pagination-pointed .current, .pagination-pointed .pagination-previous {
  position: relative;
  display: inline-block;
  padding: 6px 12px;
  margin-bottom: 0;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  border-radius: 4px;
  background-color: #2c3840;
  color: #fff;
  outline: 0;
  text-decoration: none;
  transition: all 0.2s linear;
}

.pagination-pointed .pagination-pointed-button:hover, .pagination-pointed .current:hover, .pagination-pointed .pagination-previous:hover {
  background-color: #41525e;
}

.pagination-pointed .current {
  background: dodgerblue;
}

.pagination-pointed .current:hover {
  background-color: #0077ea;
}

.pagination-pointed .pagination-next a {
  border-radius: 4px 0 0 4px;
  margin-right: 18px;
}

.pagination-pointed .pagination-next a:hover::after {
  border-left: 17px solid #41525e;
}

.pagination-pointed .pagination-next a::after {
  content: "";
  position: absolute;
  top: 0;
  right: -18px;
  width: 0;
  height: 0;
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
  border-left: 17px solid #2c3840;
  transition: all 0.2s linear;
}

.pagination-pointed .pagination-previous {
  border-radius: 0 4px 4px 0;
  margin-left: 18px;
}

.pagination-pointed .pagination-previous:hover::after {
  border-right: 17px solid #41525e;
}

.pagination-pointed .pagination-previous::before {
  content: "";
}

.pagination-pointed .pagination-previous::after {
  content: "";
  position: absolute;
  top: 0;
  left: -18px;
  width: 0;
  height: 0;
  border-bottom: 17px solid transparent;
  border-top: 17px solid transparent;
  border-right: 17px solid #2c3840;
  transition: all 0.2s linear;
}

JS