X-Git-Url: https://git.danix.xyz/?a=blobdiff_plain;f=assets%2Fsass%2Fbourbon%2Fbourbon%2Flibrary%2F_font-face.scss;fp=assets%2Fsass%2Fbourbon%2Fbourbon%2Flibrary%2F_font-face.scss;h=8aab1dc2875ab28165e51d54499c8d0c58196300;hb=2d3ca553a3d3345ec8ecdf0faedc6924cd0e2f5d;hp=0000000000000000000000000000000000000000;hpb=2ae9d02fd007f6d0bab6576f8f26d66570358605;p=theme-danix.xyz.git diff --git a/assets/sass/bourbon/bourbon/library/_font-face.scss b/assets/sass/bourbon/bourbon/library/_font-face.scss new file mode 100644 index 0000000..8aab1dc --- /dev/null +++ b/assets/sass/bourbon/bourbon/library/_font-face.scss @@ -0,0 +1,65 @@ +@charset "UTF-8"; + +/// Generates an `@font-face` declaration. You can choose the specific file +/// formats you need to output; the mixin supports `woff2` +/// and `woff`. The mixin also supports usage with the Rails Asset Pipeline, +/// which you can enable per use, or globally in the `$bourbon()` settings. +/// +/// @argument {string} $font-family +/// +/// @argument {string} $file-path +/// +/// @argument {string | list} $file-formats [("woff2", "woff")] +/// List of the font file formats to include. Can also be set globally using +/// the `global-font-file-formats` key in the Bourbon settings. +/// +/// @argument {boolean} $asset-pipeline [false] +/// Set to `true` if you’re using the Rails Asset Pipeline (place the fonts +/// in `app/assets/fonts/`). Can also be set globally using the +/// `rails-asset-pipeline` key in the Bourbon settings. +/// +/// @content +/// Any additional CSS properties that are included in the `@include` +/// directive will be output within the `@font-face` declaration, e.g. you can +/// pass in `font-weight`, `font-style` and/or `unicode-range`. +/// +/// @example scss +/// @include font-face( +/// "source-sans-pro", +/// "fonts/source-sans-pro-regular", +/// ("woff2", "woff") +/// ) { +/// font-style: normal; +/// font-weight: 400; +/// } +/// +/// // CSS Output +/// @font-face { +/// font-family: "source-sans-pro"; +/// src: url("fonts/source-sans-pro-regular.woff2") format("woff2"), +/// url("fonts/source-sans-pro-regular.woff") format("woff"); +/// font-style: normal; +/// font-weight: 400; +/// } +/// +/// @require {function} _font-source-declaration +/// +/// @require {function} _fetch-bourbon-setting + +@mixin font-face( + $font-family, + $file-path, + $file-formats: _fetch-bourbon-setting("global-font-file-formats"), + $asset-pipeline: _fetch-bourbon-setting("rails-asset-pipeline") +) { + @font-face { + font-family: $font-family; + src: _font-source-declaration( + $font-family, + $file-path, + $asset-pipeline, + $file-formats + ); + @content; + } +}