Skip to content

Instantly share code, notes, and snippets.

@tomkrush
Created February 28, 2013 16:12
Show Gist options
  • Save tomkrush/5057860 to your computer and use it in GitHub Desktop.
Save tomkrush/5057860 to your computer and use it in GitHub Desktop.
Paginate Mixin
@mixin paginate($backgroundColor: false, $textColor: #000, $selectedBackgroundColor: #000, $selectedTextColor: #fff) {
.pagination {
clear: both;
width: 100%;
overflow: hidden;
padding: 10px 0 1px 0;
margin: 20px 0 20px 0;
@include box-sizing(border-box);
ul {
margin: 0;
padding: 0;
list-style: none;
float: left;
@include responds-to(small-tablet, true) {
width: inherit;
}
li {
@include responds-to(wide-mobile, true) {
display: none;
&.next, &.prev {
display: block;
}
&.next {
float: right;
}
&.previous {
float: left;
}
}
float: left;
font-size: 14px;
&.current, &:hover {
a {
background: $selectedBackgroundColor;
color: $selectedTextColor;
}
}
a {
display: block;
text-align: center;
padding: 10px 14px 10px 14px;
color: $textColor;
@if $backgroundColor
{
background-color: $backgroundColor;
}
font-weight: bold;
text-decoration: none;
}
+ li {
margin-left: 4px;
}
}
}
.number {
float: right;
font-size: 14px;
padding: 10px 0;
@include responds-to(small-tablet, true) {
display: none;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment