Created
September 30, 2018 17:28
-
-
Save GoodNew5/55b1128a04a956e0201f72660359d1ff to your computer and use it in GitHub Desktop.
simple css-counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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