// helper function to make sure the unit type (px, rem) // is removed we want just the raw value no unit @function get-value($n) { @return $n / ($n * 0 + 1); } // pretty simple eh? @function get-line-height($font-size, $line-height) { @return get-value($line-height / $font-size); } // Usage: // Let's say you have an element that is going to be // 26px font-size and you want a line-height of 32px // you don't want to set 32px as the height because // that value will cascade down to child elements // but if you're like me you're too lazy to do // math all the time... .foo { font-size: 26px; line-height: get-line-height(26px, 32px); //1.23077 }