| Module | Sprockets::Sass::Functions |
| In: |
lib/sprockets/sass/functions.rb
|
Using Sprockets::Context#asset_data_uri return a Base64-encoded `data:` URI with the contents of the asset at the specified path.
background: asset-data-uri("image.jpg"); // background: url(data:image/jpeg;base64,...);
Using Sprockets::Helpers#asset_path, return the full path for the given source as a Sass String. This supports keyword arguments that mirror the options.
background: url(asset-path("image.jpg")); // background: url("/assets/image.jpg");
background: url(asset-path("image.jpg", $digest: true)); // background: url("/assets/image-27a8f1f96afd8d4c67a59eb9447f45bd.jpg");
Using Sprockets::Helpers#asset_path, return the url CSS for the given source as a Sass String. This supports keyword arguments that mirror the options.
background: asset-url("image.jpg"); // background: url("/assets/image.jpg");
background: asset-url("image.jpg", $digest: true); // background: url("/assets/image-27a8f1f96afd8d4c67a59eb9447f45bd.jpg");
Using Sprockets::Helpers#font_path, return the full path for the given source as a Sass String. This supports keyword arguments that mirror the options.
src: url(font-path("font.ttf")); // src: url("/assets/font.ttf");
src: url(font-path("font.ttf", $digest: true)); // src: url("/assets/font-27a8f1f96afd8d4c67a59eb9447f45bd.ttf");
Using Sprockets::Helpers#font_path, return the url CSS for the given source as a Sass String. This supports keyword arguments that mirror the options.
src: font-url("font.ttf"); // src: url("/assets/font.ttf");
src: font-url("image.jpg", $digest: true); // src: url("/assets/font-27a8f1f96afd8d4c67a59eb9447f45bd.ttf");
Using Sprockets::Helpers#image_path, return the full path for the given source as a Sass String. This supports keyword arguments that mirror the options.
background: url(image-path("image.jpg")); // background: url("/assets/image.jpg");
background: url(image-path("image.jpg", $digest: true)); // background: url("/assets/image-27a8f1f96afd8d4c67a59eb9447f45bd.jpg");
Using Sprockets::Helpers#image_path, return the url CSS for the given source as a Sass String. This supports keyword arguments that mirror the options.
background: image-url("image.jpg"); // background: url("/assets/image.jpg");
background: image-url("image.jpg", $digest: true); // background: url("/assets/image-27a8f1f96afd8d4c67a59eb9447f45bd.jpg");