/// Base path for assets (fonts, images...),
/// should not include trailing slash
/// @access public
/// @type String

$base: if(variable-exists(asset-base-path), $asset-base-path, '../');
$img: if(variable-exists(asset-images-path), $asset-images-path, 'images');
$fnt: if(variable-exists(asset-fonts-path), $asset-fonts-path, 'fonts');

/// Asset URL builder
/// @access private
/// @param {String} $type - Asset type, matching folder name
/// @param {String} $file - Asset file name, including extension
/// @return {URL} - A `url()` function leading to the asset
@function asset($type, $file) {
  @return url($base + '/' + $type + '/' + $file);
}

/// Image asset helper
/// @access public
/// @param {String} $file - Asset file name, including extension
/// @return {URL} - A `url()` function leading to the image
/// @require {function} asset
@function image($file) {
  @return asset($img, $file);
}

/// Font asset helper
/// @access public
/// @param {String} $file - Asset file name, including extension
/// @return {URL} - A `url()` function leading to the font
/// @require {function} asset
@function font($file) {
  @return asset($fnt, $file);
}
