Created
August 31, 2015 09:59
-
-
Save tmiyamon/f1083346317e88ddb3a9 to your computer and use it in GitHub Desktop.
scss adjusted custom style list
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 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