Created
July 24, 2014 16:28
-
-
Save marcelosomers/6153098f7d3198b6138d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.10) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
$base-path: "assets/" !default; | |
/** | |
* Asset handler | |
* | |
* @param {String} $type | |
* @param {String} $asset | |
* | |
* @requires {variable} base-path | |
* | |
* @return {String} Returns a `url()` function | |
*/ | |
@function asset($type, $asset) { | |
@return url($base-path + $type + '/' + $asset); | |
} | |
/** | |
* Image helper | |
* | |
* @param {String} $image | |
* | |
* @requires {function} asset | |
* | |
* @return {String} Returns a `url()` function | |
*/ | |
@function image($image) { | |
@return asset('images', $image); | |
} | |
test { | |
background: image('unicorn.jpg'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Asset handler | |
* | |
* @param {String} $type | |
* @param {String} $asset | |
* | |
* @requires {variable} base-path | |
* | |
* @return {String} Returns a `url()` function | |
*/ | |
/** | |
* Image helper | |
* | |
* @param {String} $image | |
* | |
* @requires {function} asset | |
* | |
* @return {String} Returns a `url()` function | |
*/ | |
test { | |
background: url("assets/images/unicorn.jpg"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment