// /** // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved. // * Licensed under MIT; see LICENSE.txt // */ @if $trace-imports { @debug 'imported'; } // ========================================================================== // Mixin font // -------------------------------------------------------------------------- // @param (array) $type (a valid type array: $style, $variant, $weight, $family) // @param (string) $base-font-size (a valid value in your unit of output) // @param (string) $base-line-height (a valid value in your unit of output) // ========================================================================== @mixin font($type, $base-font-size:$base-font-size, $base-line-height:$base-line-height) { @if $type { $font-style : nth($type,1); $font-variant : nth($type,2); $font-weight : nth($type,3); $font-family : nth($type,4); font: #{$font-style} #{$font-variant} #{$font-weight} #{$base-font-size}/#{$base-line-height} #{$font-family}; } } // ========================================================================== // Mixin font-style // -------------------------------------------------------------------------- // Extracts the style from a type array and mixes in font-style // -------------------------------------------------------------------------- // @param (array) $type (a valid type array: $style, $variant, $weight, $family) // ========================================================================== @mixin font-style($type) { font-style: extract-type-style($type); } // ========================================================================== // Mixin font-variant // -------------------------------------------------------------------------- // Extracts the variant from a type array and mixes in font-variant // -------------------------------------------------------------------------- // @param (array) $type (a valid type array: $style, $variant, $weight, $family) // ========================================================================== @mixin font-variant($type) { font-variant: extract-type-variant($type); } // ========================================================================== // Mixin font-weight // -------------------------------------------------------------------------- // Extracts the weight from a type array and mixes in font-weight // -------------------------------------------------------------------------- // @param (array) $type (a valid type array: $style, $variant, $weight, $family) // ========================================================================== @mixin font-weight($type) { font-weight: extract-type-weight($type); } // ========================================================================== // Mixin font-family // -------------------------------------------------------------------------- // Extracts the family from a type array and mixes in font-family // -------------------------------------------------------------------------- // @param (array) $type (a valid type array: $style, $variant, $weight, $family) // ========================================================================== @mixin font-family($type) { font-family: extract-type-family($type); } // ========================================================================== // Mixin font-size-rhythm // -------------------------------------------------------------------------- // Takes a size in any value and tries to calculate it back to the desired font-unit // ========================================================================== @mixin font-size($value, $context: $base-font-size) { $unit: unit($value); @if $unit=="px" { } @if $unit=="rem" { // Convert to pixels } @if $unit=="em" { // Convert to pixels } @if $unit=="%" { // Convert to pixels } @if $unit=="pt" { // Convert to pixels } font-size: px-to-relative-size($value); } // ========================================================================== // Mixin debug-rhythm // -------------------------------------------------------------------------- // Renders the baseline rhythm // ========================================================================== @mixin debug-rhythm { $to: transparent; $from: rgba(226, 255, 255, .5); background-image: -webkit-linear-gradient($from 50%, $to 50%); background-image: linear-gradient($from 50%, $to 50%); background-size: rhythm(2) rhythm(2); * { background-color: transcontainer !important; background-image: none !important; outline: rgba(255,0,255,.1) dotted 1px; outline: lighten( rgb(255,0,255), .1 ) dotted 1px \9; } }