Skip to content

Instantly share code, notes, and snippets.

@tohuw
Created August 20, 2016 09:48
Show Gist options
  • Save tohuw/645ed204feac1e74f8205919e1ad97ec to your computer and use it in GitHub Desktop.
Save tohuw/645ed204feac1e74f8205919e1ad97ec to your computer and use it in GitHub Desktop.
// A demonstration of how to write SASS styling for multi-level lists
// List types vary per level, and list counters are styleable
// Owes greatly to this: http://stackoverflow.com/a/15253672/316733
ol {
counter-reset: li;
margin-left: .5em;
li {
counter-increment: li;
list-style-type: none;
&::before {
color: gray;
content: counter(li) '.';
margin-right: .33em;
}
}
ol {
li::before { content: counter(li, upper-alpha) '.'; }
ol li::before { content: counter(li, lower-roman) '.'; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment