Skip to content

Instantly share code, notes, and snippets.

@tagr
Created February 21, 2015 16:24
Show Gist options
  • Save tagr/0b520a3ebf75ba8c4c35 to your computer and use it in GitHub Desktop.
Save tagr/0b520a3ebf75ba8c4c35 to your computer and use it in GitHub Desktop.
KwRKYw
ul
each val in [1, 2, 3, 4, 5, 6, 7]
li
a(href='#'+val)= val
var currentPage = parseInt(location.hash.replace('#',''), 10) | 0;
var applyEllipsis = function() {
$('a').each(function(){
$(this).addClass('ellipsis ellipsis-after');
});
}();
$baseSize: 1rem;
$color: #ccc;
$ellipsis: '...';
ul {
list-style: none;
li {
display: table-cell;
padding: $baseSize;
&:nth-child(-n+2) a,
&:nth-last-child(-n+2) a {
display: inline-block;
}
}
}
a {
//border: $baseSize*0.1 solid $color;
color: $color;
display: none;
font: 700 $baseSize sans-serif;
padding: 0.3rem $baseSize;
text-decoration: none;
}
.ellipsis {
}
.ellipsis-before {
&::before {
border: none;
content: $ellipsis;
}
}
.ellipsis-after {
&::after {
border: none;
content: $ellipsis;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment