pattern-7-1/sass/abstracts/_functions.sass

28 lines
1015 B
Sass
Raw Normal View History

2019-02-26 11:06:17 +01:00
// -----------------------------------------------------------------------------
// This file contains all application-wide Sass functions.
// -----------------------------------------------------------------------------
/// Native `url(..)` function wrapper
/// @param {String} $base - base URL for the asset
/// @param {String} $type - asset type folder (e.g. `fonts/`)
/// @param {String} $path - asset path
/// @return {Url}
2019-03-03 09:20:25 +01:00
@function asset($base, $type, $path)
@return url($base + $type + $path)
2019-02-26 11:06:17 +01:00
/// Returns URL to an image based on its path
/// @param {String} $path - image path
/// @param {String} $base [$base-url] - base URL
/// @return {Url}
/// @require $base-url
2019-03-03 09:20:25 +01:00
@function image($path, $base: $base-url)
@return asset($base, "images/", $path)
2019-02-26 11:06:17 +01:00
/// Returns URL to a font based on its path
/// @param {String} $path - font path
/// @param {String} $base [$base-url] - base URL
/// @return {Url}
/// @require $base-url
2019-03-03 09:20:25 +01:00
@function font($path, $base: $base-url)
@return asset($base, "fonts/", $path)