Skip to content

Instantly share code, notes, and snippets.

@ysakmrkm
Created July 5, 2012 06:42
Show Gist options
  • Save ysakmrkm/3051844 to your computer and use it in GitHub Desktop.
Save ysakmrkm/3051844 to your computer and use it in GitHub Desktop.
Set element top/bottom margin without line-height minus margin
@function margin($margin,$lheight,$base,$unit:0){
@if $unit != 0 {
@return ($margin + (((1 - (($lheight) / $base)) / 2) * $base))+px;
} @else {
@return ($margin + (((1 - (($lheight) / $base)) / 2) * $base));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment