Accoutrement 4.0.5

@function font-url()

This is a wrapper for the CSS url() function, which simply prepends the global $font-path when appropriate.

Since type-4.0.0:

  • BUGFIX: Supports Base64 data URI’s, without prepending font-path

Parameters & Return

$path: (string)

A path relative to the fonts directory.

@return (string)

The full path to a font file, in CSS url('my/path') format.

Example

scss
tools.$font-path: '../fonts/';
$src: tools.font-url('sans/my-sans-font.woff2');
/* #{$src} */
css compiled
/* url("../fonts/sans/my-sans-font.woff2") */

Requires

$font-path (string)

Used By

@function font-src() [private]

@mixin import-font-face() [private]