Skip to content

Instantly share code, notes, and snippets.

@daneden
Last active August 29, 2015 14:00
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 daneden/11187132 to your computer and use it in GitHub Desktop.
Save daneden/11187132 to your computer and use it in GitHub Desktop.
Directives inside property expressions
.grid--debug-cols:before {
content: '';
position: absolute;
margin: 0 auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
$cols: 5;
$output: ();
@for $i from 1 through $cols {
$output: append($output, #{"blue #{percentage($i/$cols)},"});
$output: append($output, #{"transparent #{percentage($i/$cols)},"});
$output: append($output, #{"transparent calc( #{percentage($i/$cols)} + 23px),"});
$output: append($output, #{"blue calc(#{percentage($i/$cols)} + 23px),"});
}
background-image: linear-gradient(left,
transparent,
transparent 23px,
blue 23px,
unquote($output)
blue 100%,
transparent 100%
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment