File: D:/HostingSpaces/SBogers10/stempel.komma.pro/resources/sass/site/2-Tools/_tools.fonts.scss
/* ==========================================================================
* Font related functions
* ========================================================================== */
/**
* Mixin for setting font-size in REM through a Sass Map with all available sizes
USAGE:
.myClass {
@include font-size(xl);
}
*/
@mixin font-size($fs, $lh: null) {
// Get correct key with font-size and line-height px value
$font-size-properties: map-get($font-sizes, $fs);
@if $font-size-properties {
@include font-size(map-get($font-size-properties, font-size));
@if($lh == null){
line-height: map-get($font-size-properties, line-height) / map-get($font-size-properties, font-size);
} @else {
line-height: $lh / map-get($font-size-properties, font-size);
}
}
// When mapping isn't found calculate as if PX-value was given and return REM value
@else {
@if is-number($fs) {
font-size: valueToRem($fs);
@if($lh != null){
line-height: $lh / $fs;
}
}
@else {
@warn " `#{$fs}` is not a valid value. It must be one of the following: `#{$font-sizes}`";
}
}
}
//TODO: remove function and uses
@mixin font($size, $lh: null, $weight: null) {
@include font-size($size, $lh);
}