Skip to content

Instantly share code, notes, and snippets.

@craigbutcher
Last active August 29, 2015 14:13
Show Gist options
  • Save craigbutcher/99d75bcd6176230cab77 to your computer and use it in GitHub Desktop.
Save craigbutcher/99d75bcd6176230cab77 to your computer and use it in GitHub Desktop.
Commenting System Boxes Styling using SASS
// This is for the commenting system where we can tell SASS to run 'for' loop from 1 to variable $rows
// Using nth-child + margin-left to set the styling
// Stylus version coming soon(!)
// Variable
$rows: 10;
// For loop
@for $i from 1 through $rows {
&:nth-child(#{$i}) {
margin-left: (( 20 / $rows) * $i) * 5px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment