Skip to content

Instantly share code, notes, and snippets.

@tmiyamon
Created August 31, 2015 09:59
Show Gist options
  • Save tmiyamon/f1083346317e88ddb3a9 to your computer and use it in GitHub Desktop.
Save tmiyamon/f1083346317e88ddb3a9 to your computer and use it in GitHub Desktop.
scss adjusted custom style list
@mixin custom-list($type) {
$padding: 10px;
$width: 100px;
list-style-type: none;
& > li {
counter-increment: $type;
position: relative;
&:before {
display: block;
left: -($width+$padding);
position: absolute;
text-align: right;
width: $width;
@content
}
}
}
ol {
margin: 0px;
@include custom-list(section) {
content: counter(section, decimal) ". ";
}
& > ol {
@include custom-list(subsection) {
content: "(" counter(subsection, decimal) ") ";
}
}
& > ol > ol {
@include custom-list(subsubsection) {
content: counter(subsubsection, katakana) ". ";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment