Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save rafaelrinaldi/9262102 to your computer and use it in GitHub Desktop.

Select an option

Save rafaelrinaldi/9262102 to your computer and use it in GitHub Desktop.
@function flex($target, $context, $unit: "em") {
$size: remove-unit($target) / remove-unit($context);
@if $unit == "em" { @return #{$size}em; }
@if $unit == "%" { @return perc($size); }
}
@function perc($target, $context) {
@return flex($target, $context, "%");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment