Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ifthenelse/639d207aab96b3e0e9bb to your computer and use it in GitHub Desktop.
Save ifthenelse/639d207aab96b3e0e9bb to your computer and use it in GitHub Desktop.
Dynamically set inline-block elements equal width based on items length
@for $i from 1 through 10 {
/* #{$i} item(s) */
.box-ballooned-item:first-child:nth-last-child(#{$i}),
.box-ballooned-item:first-child:nth-last-child(#{$i}) ~ .box-ballooned-item {
max-width: floor(100% / $i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment