Skip to content

Instantly share code, notes, and snippets.

@GoodNew5
Created September 30, 2018 17:28
Show Gist options
  • Save GoodNew5/55b1128a04a956e0201f72660359d1ff to your computer and use it in GitHub Desktop.
Save GoodNew5/55b1128a04a956e0201f72660359d1ff to your computer and use it in GitHub Desktop.
simple css-counter
@mixin css-counter($element, $start: 1) {
@if($start == 1) {
counter-reset: list;
}
@else {
$start: $start - 1;
counter-reset: list #{$start};
}
#{$element} {
counter-increment: list;
&:before {
content: counter(list);
@content;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment