Skip to content

Instantly share code, notes, and snippets.

@matori
Created December 19, 2012 07:37
Show Gist options
  • Save matori/4335081 to your computer and use it in GitHub Desktop.
Save matori/4335081 to your computer and use it in GitHub Desktop.
[SCSS] 連続した見出しのセレクタ
/* section がいるかどうかは変数で管理すればいいかな */
%consecutiveHeadings {
margin: 1em auto;
}
@for $i from 1 through 5 {
h#{$i} + h#{$i + 1},
h#{$i} + section > h#{$i + 1}:first-child {
@extend %consecutiveHeadings;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment